3 This file is part of libmspfs
4 Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
32 Iterator &operator++();
33 Iterator &operator--();
34 std::string operator*() const;
35 bool operator==(const Iterator &i) const { return (start==i.start && end==i.end); }
36 bool operator!=(const Iterator &i) const { return !(*this==i); }
41 Iterator(const Path &);
47 Path(const std::string &p) { init(p); }
48 Path(const char *p) { init(p); }
49 const std::string &str() const { return path; }
50 unsigned size() const;
51 bool empty() const { return path.empty(); }
52 bool is_absolute() const;
53 Path subpath(unsigned, unsigned =static_cast<unsigned>(-1)) const;
54 Path operator/(const Path &p) const { Path a=*this; a/=p; return a; }
55 Path &operator/=(const Path &);
56 std::string operator[](int) const;
57 bool operator==(const Path &) const;
58 Iterator begin() const { return Iterator(*this); }
59 Iterator end() const { Iterator i(*this); i.start=i.end=std::string::npos; return i; }
63 void init(const std::string &);
64 void add_component(const std::string &);
67 inline std::ostream &operator<<(std::ostream &o, const Path &p) { o<<p.str(); return o; }