HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_FileShortcutUtil.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_FileShortcutUtil.h (FS Library, C++)
7  *
8  * COMMENTS: Class for manipulating shortcut files on Windows.
9  * NOTE: This object must be constructed/destructed in the same
10  * thread!
11  *
12  * For other platforms, this class does nothing.
13  */
14 
15 #ifndef __UT_FILESHORTCUTUTIL_H__
16 #define __UT_FILESHORTCUTUTIL_H__
17 
18 #include "UT_API.h"
19 #include "UT_UniquePtr.h"
20 
21 class FS_Stat;
22 class UT_String;
23 
25 {
26 public:
29 
30  /// Find the real path represented by the give shortcut. If
31  /// prompt_missing is true, then when the OS fails to find the shortcut
32  /// target it will ask the user. When given the is_dir flag, it will be
33  /// set to true if the real path is a directory.
34  /// This function returns true on success.
35  bool resolve(const char *shortcut_path, UT_String &real_path,
36  bool prompt_missing, bool *is_dir = NULL) const;
37 
38  /// Create a shortcut
39  bool create(const char *shortcut_path, const char *real_path) const;
40 
41 private:
42  /// Not implemented
43  // @{
45  UT_FileShortcutUtil &operator=(const UT_FileShortcutUtil &);
46  // @}
47 
48 private:
49  struct Data;
50  UT_UniquePtr<Data> myData;
51 };
52 
53 #endif // __UT_FILESHORTCUTUTIL_H__
#define UT_API
Definition: UT_API.h:14
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
Helper class for encapsulating file information.
Definition: FS_Info.h:55