diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-24 21:28:30 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-24 21:28:30 +0000 |
commit | 0e4f68db63e565201a6eaa2f600441c37b150d1b (patch) | |
tree | b4cfc4f35e6d8ae7fa6266fd2c3faaed9e006adb /base/file_util.cc | |
parent | a86c97ccfe0038b1672d5a06d283561b7f294640 (diff) | |
download | chromium_src-0e4f68db63e565201a6eaa2f600441c37b150d1b.zip chromium_src-0e4f68db63e565201a6eaa2f600441c37b150d1b.tar.gz chromium_src-0e4f68db63e565201a6eaa2f600441c37b150d1b.tar.bz2 |
Move PathComponents from file_util to FilePath, add FilePath::IsParent()
r=erikkay,mark
Review URL: http://codereview.chromium.org/145026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.cc')
-rw-r--r-- | base/file_util.cc | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index 5f18674..c366a76 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()) |