From 94f9c526e7d1241b8889ad66c5a72c2287d0f1fe Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Wed, 13 Oct 2010 22:43:06 +0000 Subject: file_util: don't compile any of the deprecated functions on non-Windows We've removed usage of these functions on non-Windows platforms. Review URL: http://codereview.chromium.org/3762002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62470 0039d316-1c4b-4281-b951-d872f2087c98 --- base/file_util.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'base/file_util.cc') diff --git a/base/file_util.cc b/base/file_util.cc index 747232b..254e649 100644 --- a/base/file_util.cc +++ b/base/file_util.cc @@ -360,6 +360,7 @@ bool MemoryMappedFile::IsValid() { // Deprecated functions ---------------------------------------------------- +#if defined(OS_WIN) bool AbsolutePath(std::wstring* path_str) { FilePath path(FilePath::FromWStringHack(*path_str)); if (!AbsolutePath(&path)) @@ -368,8 +369,6 @@ bool AbsolutePath(std::wstring* path_str) { return true; } -#if defined(OS_WIN) -// This function is deprecated; see file_util_deprecated.h for details. void AppendToPath(std::wstring* path, const std::wstring& new_ending) { if (!path) { NOTREACHED(); @@ -380,7 +379,6 @@ void AppendToPath(std::wstring* path, const std::wstring& new_ending) { path->push_back(FilePath::kSeparators[0]); path->append(new_ending); } -#endif bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path, bool recursive) { @@ -394,11 +392,7 @@ bool Delete(const std::wstring& path, bool recursive) { std::wstring GetFileExtensionFromPath(const std::wstring& path) { FilePath::StringType extension = GetFileExtensionFromPath(FilePath::FromWStringHack(path)); -#if defined(OS_WIN) return extension; -#elif defined(OS_POSIX) - return UTF8ToWide(extension); -#endif } std::wstring GetFilenameFromPath(const std::wstring& path) { if (path.empty() || EndsWithSeparator(FilePath::FromWStringHack(path))) @@ -415,6 +409,7 @@ int ReadFile(const std::wstring& filename, char* data, int size) { int WriteFile(const std::wstring& filename, const char* data, int size) { return WriteFile(FilePath::FromWStringHack(filename), data, size); } +#endif // OS_WIN /////////////////////////////////////////////// // FileEnumerator -- cgit v1.1