OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // We're trying to transition away from paths as wstrings into using | 5 // We're trying to transition away from paths as wstrings into using |
6 // FilePath objects. This file contains declarations of deprecated | 6 // FilePath objects. This file contains declarations of deprecated |
7 // functions. By hiding them here rather in the main header, we hope | 7 // functions. By hiding them here rather in the main header, we hope |
8 // to discourage callers. | 8 // to discourage callers. |
9 | 9 |
10 // See file_util.h for documentation on all functions that don't have | 10 // See file_util.h for documentation on all functions that don't have |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 bool ReadFileToString(const std::wstring& path, std::string* contents); | 47 bool ReadFileToString(const std::wstring& path, std::string* contents); |
48 bool GetTempDir(std::wstring* path); | 48 bool GetTempDir(std::wstring* path); |
49 bool GetFileSize(const std::wstring& file_path, int64* file_size); | 49 bool GetFileSize(const std::wstring& file_path, int64* file_size); |
50 bool GetFileInfo(const std::wstring& file_path, FileInfo* info); | 50 bool GetFileInfo(const std::wstring& file_path, FileInfo* info); |
51 FILE* OpenFile(const std::string& filename, const char* mode); | 51 FILE* OpenFile(const std::string& filename, const char* mode); |
52 FILE* OpenFile(const std::wstring& filename, const char* mode); | 52 FILE* OpenFile(const std::wstring& filename, const char* mode); |
53 int ReadFile(const std::wstring& filename, char* data, int size); | 53 int ReadFile(const std::wstring& filename, char* data, int size); |
54 int WriteFile(const std::wstring& filename, const char* data, int size); | 54 int WriteFile(const std::wstring& filename, const char* data, int size); |
55 bool GetCurrentDirectory(std::wstring* path); | 55 bool GetCurrentDirectory(std::wstring* path); |
56 | 56 |
57 // Successfully deprecated on non-Windows, but Win-specific callers remain. | 57 // Functions successfully deprecated on non-Windows, but Win-specific |
| 58 // callers remain. |
58 #if defined(OS_WIN) | 59 #if defined(OS_WIN) |
59 // Returns the directory component of a path, without the trailing | 60 // Returns the directory component of a path, without the trailing |
60 // path separator, or an empty string on error. The function does not | 61 // path separator, or an empty string on error. The function does not |
61 // check for the existence of the path, so if it is passed a directory | 62 // check for the existence of the path, so if it is passed a directory |
62 // without the trailing \, it will interpret the last component of the | 63 // without the trailing \, it will interpret the last component of the |
63 // path as a file and chomp it. This does not support relative paths. | 64 // path as a file and chomp it. This does not support relative paths. |
64 // Examples: | 65 // Examples: |
65 // path == "C:\pics\jojo.jpg", returns "C:\pics" | 66 // path == "C:\pics\jojo.jpg", returns "C:\pics" |
66 // path == "C:\Windows\system32\", returns "C:\Windows\system32" | 67 // path == "C:\Windows\system32\", returns "C:\Windows\system32" |
67 // path == "C:\Windows\system32", returns "C:\Windows" | 68 // path == "C:\Windows\system32", returns "C:\Windows" |
68 // Deprecated. Use FilePath's DirName() instead. | 69 // Deprecated. Use FilePath's DirName() instead. |
69 std::wstring GetDirectoryFromPath(const std::wstring& path); | 70 std::wstring GetDirectoryFromPath(const std::wstring& path); |
| 71 |
| 72 // Appends new_ending to path, adding a separator between the two if necessary. |
| 73 void AppendToPath(std::wstring* path, const std::wstring& new_ending); |
70 #endif | 74 #endif |
71 | 75 |
72 } | 76 } |
73 | 77 |
74 #endif // BASE_FILE_UTIL_DEPRECATED_H_ | 78 #endif // BASE_FILE_UTIL_DEPRECATED_H_ |
OLD | NEW |