path.hpp

Go to the documentation of this file.
00001 /*
00002  * ====================================================================
00003  * Copyright (c) 2002-2006 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 namespace svn
00033 {
00037   class Path
00038   {
00039   private:
00040     std::string m_path;
00041     bool m_pathIsUrl;
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     bool
00084     operator== (const Path&) const;
00085 
00089     const std::string &
00090     path () const;
00091 
00095     const char * 
00096     c_str () const;
00097 
00105     bool 
00106     isset () const;
00107 
00113     const bool
00114     isUrl () const;
00115 
00121     void
00122     addComponent (const char * component);
00123 
00129     void
00130     addComponent (const std::string & component);
00131 
00138     void
00139     split (std::string & dirpath, std::string & basename) const;
00140 
00149     void
00150     split (std::string & dir, std::string & filename, std::string & ext) const;
00151 
00157     std::string
00158     basename () const;
00159 
00165     std::string
00166     dirpath () const;
00167 
00174     std::string
00175     substr (const size_t index) const;
00176 
00182     std::string
00183     unescape () const;
00184 
00188     static Path
00189     getTempDir ();
00190 
00192     size_t 
00193     length () const;
00194 
00196     std::string
00197     native () const;
00198   };
00199 }
00200 
00201 #endif
00202 /* -----------------------------------------------------------------
00203  * local variables:
00204  * eval: (load-file "../../rapidsvn-dev.el")
00205  * end:
00206  */

Generated on Fri Dec 8 18:57:44 2006 for SvnCpp by  doxygen 1.4.7