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

Side by Side Diff: base/file_util_deprecated.h

Issue 654013: Deprecate file_util::AppendToPath() on non-Windows. (Closed)
Patch Set: ok 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 unified diff | Download patch
« no previous file with comments | « base/file_util.cc ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « base/file_util.cc ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698