add a new static method to portably determine whether a patch is
[oota-llvm.git] / lib / System / Win32 / Path.inc
index fbf8f6688a57e413124255c05f562bf3110ff217..62da3a34c4501aba9078f48123914d71798fcce1 100644 (file)
@@ -125,6 +125,20 @@ Path::isValid() const {
   return true;
 }
 
+bool
+Path::isAbsolute(const char *NameStart, unsigned NameLen) {
+  assert(NameStart);
+  switch (NameLen) {
+  case 0:
+    return false;
+  case 1:
+  case 2:
+    return NameStart[0] == '/';
+  default:
+    return NameStart[0] == '/' || (NameStart[1] == ':' && NameStart[2] == '/');
+  }
+}
+
 bool 
 Path::isAbsolute() const {
   switch (path.length()) {