return result;
}
+
+bool SGPath::isAbsolute() const
+{
+ if (path.empty()) {
+ return false;
+ }
+
+#ifdef _WIN32
+ // detect '[A-Za-z]:/'
+ if (path.size() > 2) {
+ if (isalpha(path[0]) && (path[1] == ':') && (path[2] == sgDirPathSep)) {
+ return true;
+ }
+ }
+#endif
+
+ return (path[0] == sgDirPathSep);
+}
bool isFile() const;
bool isDir() const;
+
+ /**
+ * Opposite sense to isAbsolute
+ */
+ bool isRelative() const { return !isAbsolute(); }
+
+ /**
+ * Is this an absolute path?
+ * I.e starts with a directory seperator, or a single character + colon
+ */
+ bool isAbsolute() const;
private:
void fix();