X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fpath.h;h=0f333018fc2bdbb1de6d7f89182f6ded2ea8a606;hp=511d5e02ff403ed23f7212f5497316b1278836c2;hb=bfbb7edfb2ae76d23f26e0b22787617ff621747d;hpb=9a8993b390544fb3e6b23ed562e2a2d4a62e4a7c diff --git a/source/path.h b/source/path.h index 511d5e0..0f33301 100644 --- a/source/path.h +++ b/source/path.h @@ -1,3 +1,8 @@ +/* +This file is part of libmsppath +Copyright © 2006 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ #ifndef MSP_PATH_PATH_H_ #define MSP_PATH_PATH_H_ @@ -40,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; } @@ -53,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<