From a84ab9502867f91da24e19340f99d90b3b4966ff Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Tue, 23 Feb 2010 11:34:54 +0000 Subject: 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 --- base/file_util_deprecated.h | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 base/file_util_deprecated.h (limited to 'base/file_util_deprecated.h') 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_ -- cgit v1.1