00001 /* 00002 * ==================================================================== 00003 * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library (in the file LGPL.txt); if not, 00017 * write to the Free Software Foundation, Inc., 51 Franklin St, 00018 * Fifth Floor, Boston, MA 02110-1301 USA 00019 * 00020 * This software consists of voluntary contributions made by many 00021 * individuals. For exact contribution history, see the revision 00022 * history and logs, available at http://rapidsvn.tigris.org/. 00023 * ==================================================================== 00024 */ 00025 00026 #ifndef _SVNCPP_PATH_HPP_ 00027 #define _SVNCPP_PATH_HPP_ 00028 00029 // stl 00030 #include <string> 00031 00032 00033 namespace svn 00034 { 00038 class Path 00039 { 00040 private: 00041 std::string m_path; 00042 00048 void init (const char * path); 00049 00050 public: 00058 Path (const std::string & path = ""); 00059 00066 Path (const char * path); 00067 00073 Path (const Path & path); 00074 00078 Path& operator=(const Path&); 00079 00083 const std::string & 00084 path () const; 00085 00089 const char * 00090 c_str() const; 00091 00099 bool 00100 isset() const; 00101 00102 00108 void 00109 addComponent (const char * component); 00110 00111 00117 void 00118 addComponent (const std::string & component); 00119 00120 00127 void 00128 split (std::string & dirpath, std::string & basename) const; 00129 00130 00139 void 00140 split (std::string & dir, std::string & filename, std::string & ext) const; 00141 00142 00146 static Path 00147 getTempDir (); 00148 00149 00151 size_t 00152 length () const; 00153 00154 00156 std::string 00157 native () const; 00158 }; 00159 } 00160 00161 #endif 00162 /* ----------------------------------------------------------------- 00163 * local variables: 00164 * eval: (load-file "../../rapidsvn-dev.el") 00165 * end: 00166 */