Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2701)

Unified Diff: base/file_util_deprecated.h

Issue 654009: Deprecate GetDirectoryFromPath on non-Windows. (Closed)
Patch Set: with comment Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_deprecated.h
diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h
index fd28ed293d790737d132068239b4fd9c34898c3f..05fd5148123ddb11bbc16a2b878c5f094e5bd73f 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_
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698