00001 #ifndef PATH_H
00002 #define PATH_H
00003
00004
00005 #include <string>
00006 #include <vector>
00007
00008 class Path {
00009 public:
00010 Path() {}
00012 Path(const Path& p,unsigned int l);
00013
00015 bool parse(const string& path_string);
00016
00018 const string& str() const;
00019
00020 const string& operator[](unsigned int i) const { return path_[i]; }
00021 unsigned int size() const { return path_.size(); }
00022
00023 bool operator==(const Path& p) const { return path_ == p.path_; }
00024 bool operator<(const Path& p) const { return path_ < p.path_; }
00025
00026 typedef vector<string>::const_iterator iterator;
00027 iterator begin() const { return path_.begin(); }
00028 iterator end() const { return path_.end(); }
00029
00030 friend ostream& operator<<(ostream&,const Path& path);
00031 private:
00032 vector<string> path_;
00034 mutable string str_;
00035 };
00036
00037 #endif