• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

src/Path.hh

00001 /*
00002  * Copyright Staffan Gimåker 2010.
00003  *
00004  * ---
00005  *
00006  * This file is part of peekabot.
00007  *
00008  * peekabot is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * peekabot is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 #ifndef PEEKABOT_PATH_HH_INCLUDED
00023 #define PEEKABOT_PATH_HH_INCLUDED
00024 
00025 
00026 #include <list>
00027 #include <string>
00028 #include <boost/shared_ptr.hpp>
00029 #include <boost/filesystem/path.hpp>
00030 
00031 
00032 namespace peekabot
00033 {
00034     class UploadCache;
00035 
00042     class Path
00043     {
00044     public:
00045         Path();
00046 
00047         explicit Path(const std::string &path);
00048 
00049         Path(
00050             const std::string &path,
00051             const boost::shared_ptr<UploadCache> &upload_cache,
00052             const std::list<boost::filesystem::path> &search_dirs);
00053 
00054         Path(const Path &other);
00055 
00056         Path &operator=(const Path &other);
00057 
00058         boost::filesystem::path expand(
00059             const std::string &path,
00060             const std::list<boost::filesystem::path> &extra_dirs) const;
00061 
00062         boost::filesystem::path get_expanded_path() const;
00063 
00064         void set_path(const std::string &path);
00065 
00066         const std::string &get_path() const;
00067 
00068         void set_upload_cache(const boost::shared_ptr<UploadCache> &upload_cache);
00069 
00070         boost::shared_ptr<const UploadCache> get_upload_cache() const;
00071 
00072         void append_search_dir(const boost::filesystem::path &dir);
00073 
00074         void prepend_search_dir(const boost::filesystem::path &dir);
00075 
00076         void set_search_dirs(
00077             const std::list<boost::filesystem::path> &search_dirs);
00078 
00079     private:
00080         std::string m_path;
00081 
00082         boost::shared_ptr<const UploadCache> m_upload_cache;
00083 
00084         std::list<boost::filesystem::path> m_search_dirs;
00085     };
00086 }
00087 
00088 
00089 #endif // PEEKABOT_PATH_HH_INCLUDED

Generated on Sun Jan 30 2011 for peekabot by  doxygen 1.7.1