X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fpath.h;h=0f333018fc2bdbb1de6d7f89182f6ded2ea8a606;hp=f52362230ebf538468734aa4ddfd1e2cc32e0df9;hb=bfbb7edfb2ae76d23f26e0b22787617ff621747d;hpb=66bdaa1f9f833e18a07d061208ce6080f3abac06 diff --git a/source/path.h b/source/path.h index f523622..0f33301 100644 --- a/source/path.h +++ b/source/path.h @@ -45,7 +45,8 @@ public: Path(const std::string &p) { init(p); } Path(const char *p) { init(p); } const std::string &str() const { return path; } - unsigned size() const; + unsigned size() const; + bool empty() const { return path.empty(); } bool is_absolute() const; Path subpath(unsigned, unsigned =(unsigned)-1) const; Path operator/(const Path &p) const { Path a=*this; a/=p; return a; } @@ -58,6 +59,7 @@ private: std::string path; void init(const std::string &); + void add_component(const std::string &); }; inline std::ostream &operator<<(std::ostream &o, const Path &p) { o<