From a18f79afc7cf1d3369d07a2e59b4ee100d9ff9fa Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 23 Feb 2010 12:52:11 +0000 Subject: Deprecate GetDirectoryFromPath on non-Windows. Due to a bunch of changes I made last week, we now only need this in Windows-specific codepaths. BUG=24672 Review URL: http://codereview.chromium.org/654009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39715 0039d316-1c4b-4281-b951-d872f2087c98 --- base/file_util_deprecated.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'base/file_util_deprecated.h') diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h index fd28ed2..05fd514 100644 --- a/base/file_util_deprecated.h +++ b/base/file_util_deprecated.h @@ -54,6 +54,21 @@ int ReadFile(const std::wstring& filename, char* data, int size); int WriteFile(const std::wstring& filename, const char* data, int size); bool GetCurrentDirectory(std::wstring* path); +// Successfully deprecated on non-Windows, but Win-specific callers remain. +#if defined(OS_WIN) +// 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 +// without the trailing \, it will interpret the last component of the +// path as a file and chomp it. This does not support relative paths. +// Examples: +// path == "C:\pics\jojo.jpg", returns "C:\pics" +// path == "C:\Windows\system32\", returns "C:\Windows\system32" +// path == "C:\Windows\system32", returns "C:\Windows" +// Deprecated. Use FilePath's DirName() instead. +std::wstring GetDirectoryFromPath(const std::wstring& path); +#endif + } #endif // BASE_FILE_UTIL_DEPRECATED_H_ -- cgit v1.1