summaryrefslogtreecommitdiffstats
path: root/base/file_util_deprecated.h
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 11:34:54 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 11:34:54 +0000
commita84ab9502867f91da24e19340f99d90b3b4966ff (patch)
tree492dbfbe94ae640cb215cc19220caca5dfa4e4e0 /base/file_util_deprecated.h
parenteb9dd4550b8594f08ad8c9353ab2013e7860780b (diff)
downloadchromium_src-a84ab9502867f91da24e19340f99d90b3b4966ff.zip
chromium_src-a84ab9502867f91da24e19340f99d90b3b4966ff.tar.gz
chromium_src-a84ab9502867f91da24e19340f99d90b3b4966ff.tar.bz2
Move deprecated file_util declarations into a separate file.
This will make it harder to find them (discouraging new uses) and make it easier to find them for cleanup purposes. BUG=24672 TEST=compiles Review URL: http://codereview.chromium.org/654004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_deprecated.h')
-rw-r--r--base/file_util_deprecated.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h
new file mode 100644
index 0000000..fd28ed2
--- /dev/null
+++ b/base/file_util_deprecated.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// We're trying to transition away from paths as wstrings into using
+// FilePath objects. This file contains declarations of deprecated
+// functions. By hiding them here rather in the main header, we hope
+// to discourage callers.
+
+// See file_util.h for documentation on all functions that don't have
+// documentation here.
+
+#ifndef BASE_FILE_UTIL_DEPRECATED_H_
+#define BASE_FILE_UTIL_DEPRECATED_H_
+
+#include "build/build_config.h"
+
+namespace file_util {
+
+bool EndsWithSeparator(std::wstring* path);
+bool EndsWithSeparator(const std::wstring& path);
+
+// 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);
+
+bool AbsolutePath(std::wstring* path);
+
+// Use FilePath::InsertBeforeExtension.
+void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix);
+
+// Use FilePath::ReplaceExtension.
+void ReplaceExtension(FilePath* file_name,
+ const FilePath::StringType& extension);
+
+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);
+bool GetTempDir(std::wstring* path);
+bool GetFileSize(const std::wstring& file_path, int64* file_size);
+bool GetFileInfo(const std::wstring& file_path, FileInfo* info);
+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);
+bool GetCurrentDirectory(std::wstring* path);
+
+}
+
+#endif // BASE_FILE_UTIL_DEPRECATED_H_