diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 01:57:43 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-01 01:57:43 +0000 |
commit | 1bdaa60c309250932259402cc8abe0a1bb3f5b2d (patch) | |
tree | 642f105b102cde69a867ccebdb54fa9f4b943fe3 /base/file_util.cc | |
parent | ceea4a852067bb0b6a7977349c091e65b7e72976 (diff) | |
download | chromium_src-1bdaa60c309250932259402cc8abe0a1bb3f5b2d.zip chromium_src-1bdaa60c309250932259402cc8abe0a1bb3f5b2d.tar.gz chromium_src-1bdaa60c309250932259402cc8abe0a1bb3f5b2d.tar.bz2 |
Remove deprecated file_util::ReplaceExtension API.
BUG=24672
TEST=out/Debug/base_unittests
Review URL: http://codereview.chromium.org/2445001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.cc')
-rw-r--r-- | base/file_util.cc | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/base/file_util.cc b/base/file_util.cc index aea6e62..429ea01 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -76,33 +76,6 @@ void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix) { value.insert(last_dot, suffix); } -void ReplaceExtension(FilePath* path, const FilePath::StringType& extension) { - FilePath::StringType clean_extension; - // If the new extension is "" or ".", then we will just remove the current - // extension. - if (!extension.empty() && - extension != FilePath::StringType(&kExtensionSeparator, 1)) { - if (extension[0] != kExtensionSeparator) - clean_extension.append(&kExtensionSeparator, 1); - clean_extension.append(extension); - } - - FilePath::StringType& value = - const_cast<FilePath::StringType&>(path->value()); - const FilePath::StringType::size_type last_dot = - value.rfind(kExtensionSeparator); - const FilePath::StringType::size_type last_separator = - value.find_last_of(FilePath::StringType(FilePath::kSeparators)); - - // Erase the current extension, if any. - if ((last_dot > last_separator || - last_separator == FilePath::StringType::npos) && - last_dot != FilePath::StringType::npos) - value.erase(last_dot); - - value.append(clean_extension); -} - bool ContentsEqual(const FilePath& filename1, const FilePath& filename2) { // We open the file in binary format even if they are text files because // we are just comparing that bytes are exactly same in both files and not |