X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fpath.h;h=6cc14ad609bc0f6daa3c4ea1ee7c88aa551abb45;hp=749578a8797cf519695d0e9b321819987aa76521;hb=eeb6ed7b20d56578ff8c68f3c94e887d5ac768ee;hpb=7563bb650aa11207a7c128ba44468cf5ad2897c7 diff --git a/source/fs/path.h b/source/fs/path.h index 749578a..6cc14ad 100644 --- a/source/fs/path.h +++ b/source/fs/path.h @@ -34,11 +34,11 @@ public: Iterator(const Path &); public: - Iterator &operator++(); - Iterator &operator--(); + Iterator &operator++(); + Iterator &operator--(); std::string operator*() const; - bool operator==(const Iterator &i) const { return (start==i.start && end==i.end); } - bool operator!=(const Iterator &i) const { return !(*this==i); } + bool operator==(const Iterator &i) const { return (start==i.start && end==i.end); } + bool operator!=(const Iterator &i) const { return !(*this==i); } }; private: @@ -52,9 +52,9 @@ public: const std::string &str() const { return path; } /// Returns the number of components in the path. - unsigned size() const; + unsigned size() const; - bool empty() const { return path.empty(); } + bool empty() const { return path.empty(); } /// Determines whether the path starts from the root directory bool is_absolute() const; @@ -66,17 +66,18 @@ 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. - */ + /** 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; - Iterator begin() const; - Iterator end() const; + bool operator==(const Path &) const; + Iterator begin() const; + Iterator end() const; private: void init(const std::string &); + + /** Adds a component to the path. It must not contain the directory + separator character. */ void add_component(const std::string &); };