MeVisLab Toolbox Reference
macBundle.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef MAC_BUNDLE_H
14 #define MAC_BUNDLE_H
15 
17 
18 #if defined(__APPLE__)
19 
21 #include <string>
22 
23 namespace macos {
24 
27  {
28  public:
29 
31  static std::string getBundleName(const std::string &bundlePath = std::string());
32 
34  static std::string getBundleDirectory(const std::string &id = std::string());
35 
37  static std::string getBundleDirectoryOfSubDirectory(const std::string &path);
38 
41 
43  static std::string getUmbrellaBundleDirectory();
44 
46  static std::string getBundleResourcesDirectory(const std::string &bundlePath = std::string());
47 
49  static std::string getBundlePrivateFrameworksDirectory(const std::string &bundlePath = std::string());
50 
52  static std::string getBundleSharedSupportDirectory(const std::string &bundlePath = std::string());
53 
55  static std::string getBundleId(const std::string &bundlePath = std::string());
56 
58  static std::string getBundleExecutable(const std::string &bundlePath = std::string());
59 
61  static std::string getSupportAppWithName(const std::string &appName, const std::string &bundlePath = std::string());
62 
64  static std::string getSupportAppWithId(const std::string &id, const std::string &bundlePath = std::string());
65 
67  static bool isApplicationBundle(const std::string &filePath);
68 
70  static std::string getStringForInfoDictionaryKey(const std::string &key, const std::string &bundlePath = std::string());
71 
73 
79  static bool isSystemVersionSufficientForBundle(const std::string &minimumSystemVersionInfoDictKey = "MLMinimumSystemVersion",
80  bool displaySoftwareUpdateDialog = true);
81  };
82 
83 }
84 
85 #endif // __APPLE__
86 #endif // __macBundle_H
Bundle information.
Definition: macBundle.h:27
static std::string getUmbrellaBundleDirectory()
Return absolute path to the umbrella bundle directory in which this bundle is embedded....
static std::string getBundleDirectory(const std::string &id=std::string())
Return absolute path to the bundle directory of bundle with the given id or the current application i...
static std::string getBundleName(const std::string &bundlePath=std::string())
Return name of the bundle (CFBundleName)
static std::string getBundleDirectoryPreferUmbrellaBundle()
Return absolute path to the umbrella bundle directory in which this bundle is embedded....
static std::string getBundlePrivateFrameworksDirectory(const std::string &bundlePath=std::string())
Return absolute path of the given bundle's resources directory (UTF8)
static std::string getBundleDirectoryOfSubDirectory(const std::string &path)
Return absolute path to the root bundle directory of the given subdirectory (UTF8)
static std::string getStringForInfoDictionaryKey(const std::string &key, const std::string &bundlePath=std::string())
Returns string value for the given key from the bundle's Info.plist file.
static std::string getBundleExecutable(const std::string &bundlePath=std::string())
Returns absolute path of the main executable of the given bundle (UTF8)
static std::string getSupportAppWithId(const std::string &id, const std::string &bundlePath=std::string())
Returns absolute path of support application (bundles only) by looking at specific bundle folders (UT...
static std::string getBundleId(const std::string &bundlePath=std::string())
Return bundle identifier of given bundle or empty string if none was found (UTF8)
static bool isApplicationBundle(const std::string &filePath)
Returns 'true' if given path points to an application bundle (UTF8)
static bool isSystemVersionSufficientForBundle(const std::string &minimumSystemVersionInfoDictKey="MLMinimumSystemVersion", bool displaySoftwareUpdateDialog=true)
Check operating system version and display software update dialog if update is possible (UTF8)
static std::string getSupportAppWithName(const std::string &appName, const std::string &bundlePath=std::string())
Returns absolute path of support application (bundled and unbundled) by looking at specific bundle fo...
static std::string getBundleSharedSupportDirectory(const std::string &bundlePath=std::string())
Return absolute path of the given bundle's shared support directory (UTF8)
static std::string getBundleResourcesDirectory(const std::string &bundlePath=std::string())
Return absolute path of the given bundle's resources directory (UTF8)
#define OSXSUPPORT_PUBLIC_API
Symbol visibility macros.
AppleScript support.