Index: base/file_path.cc |
=================================================================== |
--- base/file_path.cc (revision 26368) |
+++ base/file_path.cc (working copy) |
@@ -159,6 +159,11 @@ |
} |
bool FilePath::IsParent(const FilePath& child) const { |
+ return AppendRelativePath(child, NULL); |
+} |
+ |
+bool FilePath::AppendRelativePath(const FilePath& child, |
+ FilePath* path) const { |
std::vector<FilePath::StringType> parent_components; |
std::vector<FilePath::StringType> child_components; |
GetComponents(&parent_components); |
@@ -194,6 +199,11 @@ |
++child_comp; |
} |
+ if (path != NULL) { |
+ for (; child_comp != child_components.end(); ++child_comp) { |
+ *path = path->Append(*child_comp); |
+ } |
+ } |
return true; |
} |