Support/PathV2: Implement reverse iteration and parent_path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120496 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2010-11-30 23:28:07 +00:00
parent 63c133b67d
commit a42cf73c77
3 changed files with 148 additions and 10 deletions
+12
View File
@@ -71,6 +71,15 @@ TEST(Support, Path) {
}
outs() << "]\n";
outs() << " Reverse Iteration: [";
for (sys::path::reverse_iterator ci = sys::path::rbegin(*i),
ce = sys::path::rend(*i);
ci != ce;
++ci) {
outs() << *ci << ',';
}
outs() << "]\n";
StringRef res;
SmallString<16> temp_store;
if (error_code ec = sys::path::root_path(*i, res))
@@ -82,6 +91,9 @@ TEST(Support, Path) {
if (error_code ec = sys::path::root_directory(*i, res))
ASSERT_FALSE(ec.message().c_str());
outs() << " root_directory: " << res << '\n';
if (error_code ec = sys::path::parent_path(*i, res))
ASSERT_FALSE(ec.message().c_str());
outs() << " parent_path: " << res << '\n';
temp_store = *i;
if (error_code ec = sys::path::make_absolute(temp_store))