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

Unified Diff: base/file_path.cc

Issue 172012: Add "bool FilePath::ReferencesParent()" which adds a clean & simple way for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months 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 | « base/file_path.h ('k') | base/file_path_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path.cc
===================================================================
--- base/file_path.cc (revision 23136)
+++ base/file_path.cc (working copy)
@@ -452,3 +452,17 @@
}
}
}
+
+bool FilePath::ReferencesParent() const {
+ std::vector<FilePath::StringType> components;
+ GetComponents(&components);
+
+ std::vector<FilePath::StringType>::const_iterator it = components.begin();
+ for (; it != components.end(); ++it) {
+ const FilePath::StringType& component = *it;
+ if (component == kParentDirectory)
+ return true;
+ }
+ return false;
+}
+
« no previous file with comments | « base/file_path.h ('k') | base/file_path_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698