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 
00033 namespace svn
00034 {
00038   class Path
00039   {
00040   private:
00041     std::string m_path;
00042 
00043     bool m_pathIsUrl;
00044 
00050     void init (const char * path);
00051 
00052   public:
00060     Path (const std::string & path = "");
00061     
00068     Path (const char * path);
00069 
00075     Path (const Path & path);
00076 
00080     Path& operator= (const Path&);
00081 
00085     const std::string &
00086     path () const;
00087 
00091     const char * 
00092     c_str () const;
00093 
00101     bool 
00102     isset () const;
00103 
00109     const bool
00110     isUrl () const;
00111 
00117     void
00118     addComponent (const char * component);
00119 
00120 
00126     void
00127     addComponent (const std::string & component);
00128 
00129 
00136     void
00137     split (std::string & dirpath, std::string & basename) const;
00138 
00139 
00148     void
00149     split (std::string & dir, std::string & filename, std::string & ext) const;
00150 
00151 
00155     static Path
00156     getTempDir ();
00157 
00158 
00160     size_t 
00161     length () const;
00162 
00163 
00165     std::string
00166     native () const;
00167   };
00168 }
00169 
00170 #endif
00171 /* -----------------------------------------------------------------
00172  * local variables:
00173  * eval: (load-file "../../rapidsvn-dev.el")
00174  * end:
00175  */

Generated on Sun May 14 14:03:06 2006 for SvnCpp by  doxygen 1.4.6