OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains utility functions for dealing with the local | 5 // This file contains utility functions for dealing with the local |
6 // filesystem. | 6 // filesystem. |
7 | 7 |
8 #ifndef BASE_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
10 | 10 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 #if defined(OS_POSIX) | 223 #if defined(OS_POSIX) |
224 // Read exactly |bytes| bytes from file descriptor |fd|, storing the result | 224 // Read exactly |bytes| bytes from file descriptor |fd|, storing the result |
225 // in |buffer|. This function is protected against EINTR and partial reads. | 225 // in |buffer|. This function is protected against EINTR and partial reads. |
226 // Returns true iff |bytes| bytes have been successfuly read from |fd|. | 226 // Returns true iff |bytes| bytes have been successfuly read from |fd|. |
227 bool ReadFromFD(int fd, char* buffer, size_t bytes); | 227 bool ReadFromFD(int fd, char* buffer, size_t bytes); |
228 #endif // defined(OS_POSIX) | 228 #endif // defined(OS_POSIX) |
229 | 229 |
230 #if defined(OS_WIN) | 230 #if defined(OS_WIN) |
231 // Resolve Windows shortcut (.LNK file) | 231 // Resolve Windows shortcut (.LNK file) |
232 // Argument path specifies a valid LNK file. On success, return true and put | 232 // This methods tries to resolve a shortcut .LNK file. If the |path| is valid |
233 // the URL into path. If path is a invalid .LNK file, return false. | 233 // returns true and puts the target into the |path|, otherwise returns |
| 234 // false leaving the path as it is. |
234 bool ResolveShortcut(FilePath* path); | 235 bool ResolveShortcut(FilePath* path); |
235 // Deprecated temporary compatibility function. | |
236 bool ResolveShortcut(std::wstring* path); | |
237 | 236 |
238 // Create a Windows shortcut (.LNK file) | 237 // Create a Windows shortcut (.LNK file) |
239 // This method creates a shortcut link using the information given. Ensure | 238 // This method creates a shortcut link using the information given. Ensure |
240 // you have initialized COM before calling into this function. 'source' | 239 // you have initialized COM before calling into this function. 'source' |
241 // and 'destination' parameters are required, everything else can be NULL. | 240 // and 'destination' parameters are required, everything else can be NULL. |
242 // 'source' is the existing file, 'destination' is the new link file to be | 241 // 'source' is the existing file, 'destination' is the new link file to be |
243 // created; for best results pass the filename with the .lnk extension. | 242 // created; for best results pass the filename with the .lnk extension. |
244 // The 'icon' can specify a dll or exe in which case the icon index is the | 243 // The 'icon' can specify a dll or exe in which case the icon index is the |
245 // resource id. | 244 // resource id. |
246 // Note that if the shortcut exists it will overwrite it. | 245 // Note that if the shortcut exists it will overwrite it. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 544 |
546 // Renames a file using the SHFileOperation API to ensure that the target file | 545 // Renames a file using the SHFileOperation API to ensure that the target file |
547 // gets the correct default security descriptor in the new path. | 546 // gets the correct default security descriptor in the new path. |
548 bool RenameFileAndResetSecurityDescriptor( | 547 bool RenameFileAndResetSecurityDescriptor( |
549 const FilePath& source_file_path, | 548 const FilePath& source_file_path, |
550 const FilePath& target_file_path); | 549 const FilePath& target_file_path); |
551 | 550 |
552 } // namespace file_util | 551 } // namespace file_util |
553 | 552 |
554 #endif // BASE_FILE_UTIL_H_ | 553 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |