|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Thin Objective-C++ bridge for locating macOS standard directories. More...
#include <AppleFolderManager.h>
Public Member Functions | |
| FolderManager () | |
| Creates the internal NSAutoreleasePool. | |
| ~FolderManager () | |
| void | CreateAppSupportDirectory (const char *appName) |
Creates the Application Support sub-directory for appName if it does not already exist. | |
| const char * | getMainBundlePath () |
| Returns the path to the application's main bundle directory. | |
| const char * | pathForDirectory (SearchPathDirectory directory, SearchPathDomainMask domainMask) |
| Returns the first path for the given directory and domain mask. | |
| const char * | pathForDirectoryAppropriateForItemAtPath (SearchPathDirectory directory, SearchPathDomainMask domainMask, const char *itemPath, bool create=false) |
Returns a path appropriate for storing a file at itemPath. | |
Thin Objective-C++ bridge for locating macOS standard directories.
FolderManager wraps a hidden NSAutoreleasePool and delegates to NSSearchPathForDirectoriesInDomains() so that C++ code can locate standard directories (Application Support, Caches, main bundle, etc.) without including Objective-C headers directly.
This class is only available on Apple platforms.
| Ship::FolderManager::FolderManager | ( | ) |
Creates the internal NSAutoreleasePool.
| Ship::FolderManager::~FolderManager | ( | ) |
| void Ship::FolderManager::CreateAppSupportDirectory | ( | const char * | appName | ) |
Creates the Application Support sub-directory for appName if it does not already exist.
| appName | Application name used as the sub-directory name inside Application Support. |
| const char * Ship::FolderManager::getMainBundlePath | ( | ) |
Returns the path to the application's main bundle directory.
| const char * Ship::FolderManager::pathForDirectory | ( | SearchPathDirectory | directory, |
| SearchPathDomainMask | domainMask | ||
| ) |
Returns the first path for the given directory and domain mask.
| directory | Standard directory constant (e.g. NSApplicationSupportDirectory). |
| domainMask | Domain(s) to search (e.g. NSUserDomainMask). |
| const char * Ship::FolderManager::pathForDirectoryAppropriateForItemAtPath | ( | SearchPathDirectory | directory, |
| SearchPathDomainMask | domainMask, | ||
| const char * | itemPath, | ||
| bool | create = false |
||
| ) |
Returns a path appropriate for storing a file at itemPath.
Optionally creates the returned directory if create is true.
| directory | Standard directory constant. |
| domainMask | Domain(s) to search. |
| itemPath | Path of the item to be stored (used as a hint). |
| create | If true, the directory is created before the path is returned. |