X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fpath.h;h=c3c599a9e03d0a0dae8b9e47187086b49b407d1a;hp=6cc14ad609bc0f6daa3c4ea1ee7c88aa551abb45;hb=dce2985e07e6184f000ef176451150710e21ee35;hpb=eeb6ed7b20d56578ff8c68f3c94e887d5ac768ee diff --git a/source/fs/path.h b/source/fs/path.h index 6cc14ad..c3c599a 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,6 +69,12 @@ 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; @@ -73,12 +82,6 @@ public: 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 &); }; inline std::ostream &operator<<(std::ostream &o, const Path &p) { o<