+/*
+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_
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 subpath(unsigned, unsigned =static_cast<unsigned>(-1)) const;
Path operator/(const Path &p) const { Path a=*this; a/=p; return a; }
Path &operator/=(const Path &);
std::string operator[](int) const;
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<<p.str(); return o; }