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

Unified Diff: base/file_util.cc

Issue 145026: Move PathComponents from file_util to FilePath, add FilePath::IsParent() (Closed)
Patch Set: noop Created 11 years, 6 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_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index 5f186742a71aa3da5811faab50b04d7d69a21dab..c366a76e49e416054d0f9ec2cb9409141ec7aacb 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -26,34 +26,6 @@ const FilePath::CharType kExtensionSeparator = FILE_PATH_LITERAL('.');
namespace file_util {
-void PathComponents(const FilePath& path,
- std::vector<FilePath::StringType>* components) {
- DCHECK(components);
- if (!components)
- return;
-
- FilePath::StringType path_str = path.value();
- FilePath::StringType::size_type start = 0;
- FilePath::StringType::size_type end =
- path_str.find_first_of(FilePath::kSeparators);
-
- // If the path starts with a separator, add it to components.
- if (end == start) {
- components->push_back(FilePath::StringType(path_str, 0, 1));
- start = end + 1;
- end = path_str.find_first_of(FilePath::kSeparators, start);
- }
- while (end != FilePath::StringType::npos) {
- FilePath::StringType component =
- FilePath::StringType(path_str, start, end - start);
- components->push_back(component);
- start = end + 1;
- end = path_str.find_first_of(FilePath::kSeparators, start);
- }
-
- components->push_back(FilePath::StringType(path_str, start));
-}
-
bool EndsWithSeparator(const FilePath& path) {
FilePath::StringType value = path.value();
if (value.empty())
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698