X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fpath.h;h=e560d3f96c4b3e1ae5b718f5d4a724e4fc8a57c2;hp=8c24f191394e5198d14fd7222f54f3c7bf1a6df6;hb=fa77438b62207466c48620604c8cc34931080936;hpb=a17d6ad286e19e2222ab8b6c9a762a83bf2c6c56 diff --git a/source/path.h b/source/path.h index 8c24f19..e560d3f 100644 --- a/source/path.h +++ b/source/path.h @@ -17,12 +17,17 @@ namespace FS { 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: @@ -32,7 +37,7 @@ public: private: const Path &path; - unsigned start,end; + std::string::size_type start,end; Iterator(const Path &); public: @@ -62,7 +67,7 @@ public: bool is_absolute() const; /// Extracts a range of components from the path. - Path subpath(unsigned start, unsigned count=static_cast(-1)) const; + Path subpath(unsigned start, unsigned count = static_cast(-1)) const; /// Concatenates this path with another one, with usual filesystem semantics Path operator/(const Path &p) const;