X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fpath.h;h=c701e60f7fb97dbf507cf0295ea13adefb32aec1;hp=6cc14ad609bc0f6daa3c4ea1ee7c88aa551abb45;hb=fbc986fca28ce01240718a7835ee7e4798b5d20d;hpb=eeb6ed7b20d56578ff8c68f3c94e887d5ac768ee diff --git a/source/fs/path.h b/source/fs/path.h index 6cc14ad..c701e60 100644 --- a/source/fs/path.h +++ b/source/fs/path.h @@ -30,7 +30,7 @@ public: private: const Path &path; - std::string::size_type start,end; + 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,19 +69,25 @@ public: Path operator/(const Path &p) const; Path &operator/=(const 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