OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 #if defined(OS_WIN) | 228 #if defined(OS_WIN) |
229 enum ShortcutOptions { | 229 enum ShortcutOptions { |
230 SHORTCUT_NO_OPTIONS = 0, | 230 SHORTCUT_NO_OPTIONS = 0, |
231 // Set DualMode property for Windows 8 Metro-enabled shortcuts. | 231 // Set DualMode property for Windows 8 Metro-enabled shortcuts. |
232 SHORTCUT_DUAL_MODE = 1 << 0, | 232 SHORTCUT_DUAL_MODE = 1 << 0, |
233 // Create a new shortcut (overwriting if necessary). | 233 // Create a new shortcut (overwriting if necessary). |
234 SHORTCUT_CREATE_ALWAYS = 1 << 1, | 234 SHORTCUT_CREATE_ALWAYS = 1 << 1, |
235 }; | 235 }; |
236 | 236 |
237 // Resolve Windows shortcut (.LNK file) | 237 // Resolve Windows shortcut (.LNK file) |
238 // This methods tries to resolve a shortcut .LNK file. If the |path| is valid | 238 // This methods tries to resolve a shortcut .LNK file. The path of the shortcut |
239 // returns true and puts the target into the |path|, otherwise returns | 239 // to resolve is in |shortcut_path|. If |target_path| is not NULL, the target |
240 // false leaving the path as it is. | 240 // will be resolved and placed in |target_path|. If |args| is not NULL, the |
241 BASE_EXPORT bool ResolveShortcut(FilePath* path); | 241 // arguments will be retrieved and placed in |args|. The function returns true |
| 242 // if all requested fields are are found successfully. |
| 243 BASE_EXPORT bool ResolveShortcut(const FilePath& shortcut_path, |
| 244 FilePath* target_path, |
| 245 string16* args); |
242 | 246 |
243 // Creates (or updates) a Windows shortcut (.LNK file) | 247 // Creates (or updates) a Windows shortcut (.LNK file) |
244 // This method creates (or updates) a shortcut link using the information given. | 248 // This method creates (or updates) a shortcut link using the information given. |
245 // Ensure you have initialized COM before calling into this function. | 249 // Ensure you have initialized COM before calling into this function. |
246 // |destination| is required. |source| is required when SHORTCUT_CREATE_ALWAYS | 250 // |destination| is required. |source| is required when SHORTCUT_CREATE_ALWAYS |
247 // is specified in |options|. All other parameters are optional and may be NULL. | 251 // is specified in |options|. All other parameters are optional and may be NULL. |
248 // |source| is the existing file, |destination| is the new link file to be | 252 // |source| is the existing file, |destination| is the new link file to be |
249 // created; for best results pass the filename with the .lnk extension. | 253 // created; for best results pass the filename with the .lnk extension. |
250 // The |icon| can specify a dll or exe in which case the icon index is the | 254 // The |icon| can specify a dll or exe in which case the icon index is the |
251 // resource id. |app_id| is the app model id for the shortcut on Win7. | 255 // resource id. |app_id| is the app model id for the shortcut on Win7. |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 }; | 669 }; |
666 | 670 |
667 // Attempts determine the FileSystemType for |path|. | 671 // Attempts determine the FileSystemType for |path|. |
668 // Returns false if |path| doesn't exist. | 672 // Returns false if |path| doesn't exist. |
669 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); | 673 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); |
670 #endif | 674 #endif |
671 | 675 |
672 } // namespace file_util | 676 } // namespace file_util |
673 | 677 |
674 #endif // BASE_FILE_UTIL_H_ | 678 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |