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

Unified Diff: base/file_util_deprecated.h

Issue 2850042: Deprecate more old filepath functions. (Closed)
Patch Set: rebase Created 10 years, 5 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 | « no previous file | base/file_util_unittest.cc » ('j') | chrome/browser/download/download_manager.cc » ('J')
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 a5b7899c9395bf4d07606caeb622031144542194..dd2ffc85c92ed7f030491d89f9c57f925c4bf30f 100644
--- a/base/file_util_deprecated.h
+++ b/base/file_util_deprecated.h
@@ -15,29 +15,17 @@
#include "build/build_config.h"
-namespace file_util {
-
-// Use FilePath::Extension instead.
-FilePath::StringType GetFileExtensionFromPath(const FilePath& path);
-std::wstring GetFileExtensionFromPath(const std::wstring& path);
-bool AbsolutePath(std::wstring* path);
-
-// Use FilePath::InsertBeforeExtension.
-void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix);
+namespace file_util {
-bool Delete(const std::wstring& path, bool recursive);
-bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path,
- bool recursive);
-bool ReadFileToString(const std::wstring& path, std::string* contents);
+// Use the FilePath versions instead.
FILE* OpenFile(const std::string& filename, const char* mode);
FILE* OpenFile(const std::wstring& filename, const char* mode);
-int ReadFile(const std::wstring& filename, char* data, int size);
-int WriteFile(const std::wstring& filename, const char* data, int size);
-// Functions successfully deprecated on non-Windows, but Win-specific
-// callers remain.
+// We've successfully deprecated most of these functions on non-Windows
+// platforms.
#if defined(OS_WIN)
+
// Use FilePath::DirName instead.
void UpOneDirectory(std::wstring* dir);
// Use FilePath::DirName instead.
@@ -60,7 +48,25 @@ std::wstring GetDirectoryFromPath(const std::wstring& path);
// Appends new_ending to path, adding a separator between the two if necessary.
void AppendToPath(std::wstring* path, const std::wstring& new_ending);
-#endif
+
+// Use FilePath::Extension instead.
+FilePath::StringType GetFileExtensionFromPath(const FilePath& path);
+std::wstring GetFileExtensionFromPath(const std::wstring& path);
+
+bool AbsolutePath(std::wstring* path);
+
+// Use FilePath::InsertBeforeExtension.
+void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix);
+
+// Use version that takes a FilePath.
+bool Delete(const std::wstring& path, bool recursive);
+bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path,
+ bool recursive);
+bool ReadFileToString(const std::wstring& path, std::string* contents);
+int ReadFile(const std::wstring& filename, char* data, int size);
+int WriteFile(const std::wstring& filename, const char* data, int size);
+
+#endif // OS_WIN
}
« no previous file with comments | « no previous file | base/file_util_unittest.cc » ('j') | chrome/browser/download/download_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698