summaryrefslogtreecommitdiffstats
path: root/base/file_util.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-04 19:45:42 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-04 19:45:42 +0000
commitb70f8522356988f608a2341dfcbcbe5166c79e08 (patch)
tree1a2c6da6b88c65252ffaaede632429f3be979ff8 /base/file_util.cc
parent6d0146cad42a3cc2b964e7f3cb38f235b4242144 (diff)
downloadchromium_src-b70f8522356988f608a2341dfcbcbe5166c79e08.zip
chromium_src-b70f8522356988f608a2341dfcbcbe5166c79e08.tar.gz
chromium_src-b70f8522356988f608a2341dfcbcbe5166c79e08.tar.bz2
base: Get rid of a deprecated version of file_util::GetFileExtensionFromPath().
BUG=76112 TEST=None R=evan@chromium.org Review URL: http://codereview.chromium.org/7461132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.cc')
-rw-r--r--base/file_util.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 7cf67dd2..9c3381e 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -47,15 +47,6 @@ bool EnsureEndsWithSeparator(FilePath* path) {
return true;
}
-FilePath::StringType GetFileExtensionFromPath(const FilePath& path) {
- FilePath::StringType file_name = path.BaseName().value();
- const FilePath::StringType::size_type last_dot =
- file_name.rfind(kExtensionSeparator);
- return FilePath::StringType(last_dot == FilePath::StringType::npos ?
- FILE_PATH_LITERAL("") :
- file_name, last_dot+1);
-}
-
void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix) {
FilePath::StringType& value =
const_cast<FilePath::StringType&>(path->value());
@@ -382,9 +373,10 @@ bool Delete(const std::wstring& path, bool recursive) {
return Delete(FilePath::FromWStringHack(path), recursive);
}
std::wstring GetFileExtensionFromPath(const std::wstring& path) {
- FilePath::StringType extension =
- GetFileExtensionFromPath(FilePath::FromWStringHack(path));
- return extension;
+ std::wstring file_name = FilePath(path).BaseName().value();
+ const std::wstring::size_type last_dot = file_name.rfind(kExtensionSeparator);
+ return std::wstring(last_dot == std::wstring::npos ? L""
+ : file_name, last_dot + 1);
}
FILE* OpenFile(const std::wstring& filename, const char* mode) {
return OpenFile(FilePath::FromWStringHack(filename), mode);