summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--base/file_util.cc18
-rw-r--r--base/file_util_deprecated.h1
2 files changed, 5 insertions, 14 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);
diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h
index d24e54d..675ee61 100644
--- a/base/file_util_deprecated.h
+++ b/base/file_util_deprecated.h
@@ -32,7 +32,6 @@ BASE_API FILE* OpenFile(const std::wstring& filename, const char* mode);
BASE_API void AppendToPath(std::wstring* path, const std::wstring& new_ending);
// Use FilePath::Extension instead.
-BASE_API FilePath::StringType GetFileExtensionFromPath(const FilePath& path);
BASE_API std::wstring GetFileExtensionFromPath(const std::wstring& path);
// Use version that takes a FilePath.