return make_error_code(errc::success);
}
+error_code is_absolute(const Twine &path, bool &result) {
+ SmallString<128> path_storage;
+ StringRef p = path.toStringRef(path_storage);
+
+ bool rootDir = false,
+ rootName = false;
+ if (error_code ec = has_root_directory(p, rootDir)) return ec;
+#ifdef LLVM_ON_WIN32
+ if (error_code ec = has_root_name(p, rootName)) return ec;
+#else
+ rootName = true;
+#endif
+
+ result = rootDir && rootName;
+ return make_error_code(errc::success);
+}
+
+error_code is_relative(const Twine &path, bool &result) {
+ bool res;
+ error_code ec = is_absolute(path, res);
+ result = !res;
+ return ec;
+}
+
}
}
}
TEST_PATH(stem, *i, sfres);
TEST_PATH(has_extension, *i, bres);
TEST_PATH(extension, *i, sfres);
+ TEST_PATH(is_absolute, *i, bres);
+ TEST_PATH(is_relative, *i, bres);
SmallString<16> temp_store;
TEST_PATH_SMALLVEC(make_absolute, *i, temp_store);