X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ffs%2Fpath.h;h=d515d7817031c1df3f98d0ad459c92a597b0dbcc;hb=5eb788bd9a41895585d4bb366a683437ddf63ad5;hp=ed9cc7985b62d863f86a6bc19726de692791d077;hpb=e1452710edb6b1d0ebceb4b9273dae4b2f899630;p=libs%2Fcore.git diff --git a/source/fs/path.h b/source/fs/path.h index ed9cc79..d515d78 100644 --- a/source/fs/path.h +++ b/source/fs/path.h @@ -29,8 +29,8 @@ public: friend class Path; private: - const Path &path; - std::string::size_type start,end; + const Path *path; + std::string::size_type start, end; Iterator(const Path &); public: @@ -48,7 +48,10 @@ public: Path(); Path(const std::string &); Path(const char *); +private: + void init(const std::string &); +public: const std::string &str() const { return path; } /// Returns the number of components in the path. @@ -66,18 +69,25 @@ public: Path operator/(const Path &p) const; Path &operator/=(const Path &); - /** - Extracts a single component from the path. Negative indices count from the - end of the path. - */ +private: + /** Adds a component to the path. It must not contain the directory + separator character. */ + void add_component(const std::string &); + +public: + /** Extracts a single component from the path. Negative indices count from + the end of the path. */ std::string operator[](int) const; bool operator==(const Path &) const; + bool operator<(const Path &) const; + bool operator>(const Path &) const; + bool operator<=(const Path &other) const { return !(*this>other); } + bool operator>=(const Path &other) const { return !(*this