enum
{
#ifdef WIN32
- DIRSEP='\\'
+ DIRSEP = '\\'
#else
- DIRSEP='/'
+ DIRSEP = '/'
#endif
};
+/**
+Stores a filesystem path. Paths are always stored in a normalized form; there
+are never any "." or ".." components in the middle of the path, and relative
+paths always begin with a single "." component or a sequence ".." components.
+*/
class Path
{
public:
private:
const Path &path;
- unsigned start,end;
+ std::string::size_type start,end;
Iterator(const Path &);
public:
bool is_absolute() const;
/// Extracts a range of components from the path.
- Path subpath(unsigned start, unsigned count=static_cast<unsigned>(-1)) const;
+ Path subpath(unsigned start, unsigned count = static_cast<unsigned>(-1)) const;
/// Concatenates this path with another one, with usual filesystem semantics
Path operator/(const Path &p) const;