]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/path.cpp
Add other comparison operators to FS::Path
[libs/core.git] / source / fs / path.cpp
index 035e2200609bf5f6b4f1c4e6ca59a31a6e22cf6f..c56505e907eb3fd9ce756f430f23e6f22aed7bd1 100644 (file)
@@ -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<other.path;
+#endif
+}
+
+bool Path::operator>(const Path &other) const
+{
+#ifdef WIN32
+       return strcasecmp(path, other.path)>0;
+#else
+       return path>other.path;
 #endif
 }