X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ffs%2Fpath.cpp;h=c56505e907eb3fd9ce756f430f23e6f22aed7bd1;hb=fbc986fca28ce01240718a7835ee7e4798b5d20d;hp=90c4d70e2a91b55789eb5e2b5a8dc4ecb5bf1598;hpb=8552e6a4e4fbc454e08c582d1dbcd55ab58a3c37;p=libs%2Fcore.git diff --git a/source/fs/path.cpp b/source/fs/path.cpp index 90c4d70..c56505e 100644 --- a/source/fs/path.cpp +++ b/source/fs/path.cpp @@ -183,12 +183,30 @@ string Path::operator[](int n) const throw invalid_argument("Path::operator[]"); } -bool Path::operator==(const Path &p) const +bool Path::operator==(const Path &other) const { #ifdef WIN32 - return !strcasecmp(path, p.path); + return strcasecmp(path, other.path)==0; #else - return path==p.path; + return path==other.path; +#endif +} + +bool Path::operator<(const Path &other) const +{ +#ifdef WIN32 + return strcasecmp(path, other.path)<0; +#else + return path(const Path &other) const +{ +#ifdef WIN32 + return strcasecmp(path, other.path)>0; +#else + return path>other.path; #endif } @@ -210,7 +228,7 @@ Path::Iterator::Iterator(const Path &p): start(0) { if(path.path.empty()) - start=end = string::npos; + start = end = string::npos; else if(path.path[0]==DIRSEP) end = 1; #ifdef WIN32