Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1238)

Unified Diff: base/file_path.h

Issue 14827: Implement FilePath::Contains() (Closed)
Patch Set: Make it work on mac and linux Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path.h
diff --git a/base/file_path.h b/base/file_path.h
index 9049176265f53ddee786c9c54fafe58400859223..cfe0f2ac095d93b84343218e4a167ecb6f14ce9c 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -159,6 +159,11 @@ class FilePath {
// platforms, an absolute path begins with a separator character.
bool IsAbsolute() const;
+ // Returns true if this FilePath represents a parent dir of |other|. Both
+ // paths are normalized before doing the comparison, but neither |this| nor
+ // |other| are modified.
+ bool Contains(const FilePath& other) const;
+
// Returns a copy of this FilePath that does not end with a trailing
// separator.
FilePath StripTrailingSeparators() const;
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698