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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. If the |path| is valid |
239 // returns true and puts the target into the |path|, otherwise returns | 239 // returns true and puts the target into the |path|, otherwise returns |
240 // false leaving the path as it is. | 240 // false leaving the path as it is. |
241 BASE_EXPORT bool ResolveShortcut(FilePath* path); | 241 BASE_EXPORT bool ResolveShortcut(FilePath* path); |
242 | 242 |
| 243 // Read the program arguments from the shortcut in |shortcut_path|. The result |
| 244 // of the operation is stored in |args|, which must not be NULL. |
| 245 BASE_EXPORT bool GetShortcutArguments(const FilePath& shortcut_path, |
| 246 string16* args); |
| 247 |
243 // Creates (or updates) a Windows shortcut (.LNK file) | 248 // Creates (or updates) a Windows shortcut (.LNK file) |
244 // This method creates (or updates) a shortcut link using the information given. | 249 // This method creates (or updates) a shortcut link using the information given. |
245 // Ensure you have initialized COM before calling into this function. | 250 // Ensure you have initialized COM before calling into this function. |
246 // |destination| is required. |source| is required when SHORTCUT_CREATE_ALWAYS | 251 // |destination| is required. |source| is required when SHORTCUT_CREATE_ALWAYS |
247 // is specified in |options|. All other parameters are optional and may be NULL. | 252 // 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 | 253 // |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. | 254 // 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 | 255 // 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. | 256 // resource id. |app_id| is the app model id for the shortcut on Win7. |
252 // |options|: bitfield for which the options come from ShortcutOptions. | 257 // |options|: bitfield for which the options come from ShortcutOptions. |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 }; | 670 }; |
666 | 671 |
667 // Attempts determine the FileSystemType for |path|. | 672 // Attempts determine the FileSystemType for |path|. |
668 // Returns false if |path| doesn't exist. | 673 // Returns false if |path| doesn't exist. |
669 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); | 674 BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type); |
670 #endif | 675 #endif |
671 | 676 |
672 } // namespace file_util | 677 } // namespace file_util |
673 | 678 |
674 #endif // BASE_FILE_UTIL_H_ | 679 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |