X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffs%2Fpath.h;h=1b15047cc528ece01f9d2061fcd0fd3740dedfef;hb=5d3a5019399f97af0371f4fd6dc415d36de6ac3a;hp=3cbfb16cf6e4052c57d223cd1fafd96b377b1c98;hpb=eca23d70c9e2c0519125f2fd92c212d3c94f7736;p=libs%2Fcore.git diff --git a/source/fs/path.h b/source/fs/path.h index 3cbfb16..1b15047 100644 --- a/source/fs/path.h +++ b/source/fs/path.h @@ -4,13 +4,14 @@ #include #include #include +#include namespace Msp { namespace FS { enum { -#ifdef WIN32 +#ifdef _WIN32 DIRSEP = '\\' #else DIRSEP = '/' @@ -28,13 +29,13 @@ A path can also be treated as an array of components, supporting indexing, iteration and slicing. In this context the root directory is treated as a component of its own. */ -class Path +class MSPCORE_API Path { private: typedef std::vector PositionArray; public: - class Iterator + class MSPCORE_API Iterator { public: typedef PositionArray::difference_type difference_type; @@ -67,16 +68,13 @@ public: private: std::string path; - std::vector separators; + PositionArray separators; public: - Path(); + Path() = default; Path(const std::string &); - Path(const char *); -private: - void init(const std::string &); + Path(const char *p): Path(std::string(p)) { } -public: /// Returns the path as a string. const std::string &str() const { return path; }