diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 23:19:02 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 23:19:02 +0000 |
commit | 8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f (patch) | |
tree | 0a6a1df23fc78afc64a8b8c4382792a2f7c7a06d /base | |
parent | 5d48cfa886921a239ef130f9e0204c324510f3c9 (diff) | |
download | chromium_src-8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f.zip chromium_src-8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f.tar.gz chromium_src-8d19c7d3c2cced64a6e1dd22bc893cd5fe25eb2f.tar.bz2 |
Deprecate more old filepath functions.
These still exist on Windows due to being used by the installer,
but by moving them into the Windows-only block we prevent them
from being used in new code.
BUG=24672
Review URL: http://codereview.chromium.org/2861042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_util_deprecated.h | 16 | ||||
-rw-r--r-- | base/file_util_unittest.cc | 3 |
2 files changed, 11 insertions, 8 deletions
diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h index 6eae211..a5b7899 100644 --- a/base/file_util_deprecated.h +++ b/base/file_util_deprecated.h @@ -17,14 +17,6 @@ namespace file_util { -// Use FilePath::DirName instead. -void UpOneDirectory(std::wstring* dir); -// Use FilePath::DirName instead. -void UpOneDirectoryOrEmpty(std::wstring* dir); - -// Use FilePath::BaseName instead. -std::wstring GetFilenameFromPath(const std::wstring& path); - // Use FilePath::Extension instead. FilePath::StringType GetFileExtensionFromPath(const FilePath& path); std::wstring GetFileExtensionFromPath(const std::wstring& path); @@ -46,6 +38,14 @@ int WriteFile(const std::wstring& filename, const char* data, int size); // Functions successfully deprecated on non-Windows, but Win-specific // callers remain. #if defined(OS_WIN) +// Use FilePath::DirName instead. +void UpOneDirectory(std::wstring* dir); +// Use FilePath::DirName instead. +void UpOneDirectoryOrEmpty(std::wstring* dir); + +// Use FilePath::BaseName instead. +std::wstring GetFilenameFromPath(const std::wstring& path); + // Returns the directory component of a path, without the trailing // path separator, or an empty string on error. The function does not // check for the existence of the path, so if it is passed a directory diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc index 4827f59..fd54963 100644 --- a/base/file_util_unittest.cc +++ b/base/file_util_unittest.cc @@ -325,6 +325,8 @@ static const struct filename_case { #endif }; +#if defined(OS_WIN) +// This function is deprecated on non-Windows. TEST_F(FileUtilTest, GetFilenameFromPath) { for (unsigned int i = 0; i < arraysize(filename_cases); ++i) { const filename_case& value = filename_cases[i]; @@ -332,6 +334,7 @@ TEST_F(FileUtilTest, GetFilenameFromPath) { EXPECT_EQ(value.filename, result); } } +#endif // Test finding the file type from a path name static const struct extension_case { |