|
| 1 | +// |
| 2 | +// OSXFolderManager.h |
| 3 | +// libultraship |
| 4 | +// |
| 5 | +// Created by David Chavez on 28.06.22. |
| 6 | +// |
| 7 | + |
| 8 | +#ifndef OSXFolderManager_h |
| 9 | +#define OSXFolderManager_h |
| 10 | + |
| 11 | +#include <stdio.h> |
| 12 | +namespace Ship { |
| 13 | + enum { |
| 14 | + NSApplicationDirectory = 1, |
| 15 | + NSDemoApplicationDirectory, |
| 16 | + NSDeveloperApplicationDirectory, |
| 17 | + NSAdminApplicationDirectory, |
| 18 | + NSLibraryDirectory, |
| 19 | + NSDeveloperDirectory, |
| 20 | + NSUserDirectory, |
| 21 | + NSDocumentationDirectory, |
| 22 | + NSDocumentDirectory, |
| 23 | + NSCoreServiceDirectory, |
| 24 | + NSAutosavedInformationDirectory = 11, |
| 25 | + NSDesktopDirectory = 12, |
| 26 | + NSCachesDirectory = 13, |
| 27 | + NSApplicationSupportDirectory = 14, |
| 28 | + NSDownloadsDirectory = 15, |
| 29 | + NSInputMethodsDirectory = 16, |
| 30 | + NSMoviesDirectory = 17, |
| 31 | + NSMusicDirectory = 18, |
| 32 | + NSPicturesDirectory = 19, |
| 33 | + NSPrinterDescriptionDirectory = 20, |
| 34 | + NSSharedPublicDirectory = 21, |
| 35 | + NSPreferencePanesDirectory = 22, |
| 36 | + NSApplicationScriptsDirectory = 23, |
| 37 | + NSItemReplacementDirectory = 99, |
| 38 | + NSAllApplicationsDirectory = 100, |
| 39 | + NSAllLibrariesDirectory = 101, |
| 40 | + NSTrashDirectory = 102 |
| 41 | + }; |
| 42 | + typedef unsigned long SearchPathDirectory; |
| 43 | + |
| 44 | + enum { |
| 45 | + NSUserDomainMask = 1, // user's home directory --- place to install user's personal items (~) |
| 46 | + NSLocalDomainMask = 2, // local to the current machine --- place to install items available to everyone on this machine (/Library) |
| 47 | + NSNetworkDomainMask = 4, // publically available location in the local area network --- place to install items available on the network (/Network) |
| 48 | + NSSystemDomainMask = 8, // provided by Apple, unmodifiable (/System) |
| 49 | + NSAllDomainsMask = 0x0ffff // all domains: all of the above and future items |
| 50 | + }; |
| 51 | + typedef unsigned long SearchPathDomainMask; |
| 52 | + |
| 53 | + class FolderManager { |
| 54 | + public: |
| 55 | + const char *pathForDirectory(SearchPathDirectory directory, SearchPathDomainMask domainMask); |
| 56 | + const char *pathForDirectoryAppropriateForItemAtPath(SearchPathDirectory directory, SearchPathDomainMask domainMask, const char *itemPath, bool create = false); |
| 57 | + }; |
| 58 | +}; |
| 59 | + |
| 60 | +#endif /* OSXFolderManager_h */ |
0 commit comments