00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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