Utilities for accessing application information. More...
#include <App.hpp>
Static Public Member Functions | |
static Resource::File | getApplicationRuntimeDataDirectory (const std::string &appGroup, const std::string &appName) |
Get the runtime data directory for the current application. More... | |
static Resource::File | getGlobalApplicationConfigDirectory (const std::string &appGroup, const std::string &appName) |
Get the global config directory for the specified application group/name. More... | |
static Resource::File | getGlobalApplicationDataDirectory (const std::string &appGroup, const std::string &appName) |
Get the global data directory for the specified application group/name. More... | |
static Resource::File | getUserApplicationConfigDirectory (const std::string &appGroup, const std::string &appName) |
Get the user config directory for the specified application group/name. More... | |
static Resource::File | getUserApplicationDataDirectory (const std::string &appGroup, const std::string &appName) |
Get the user data directory for the specified application group/name. More... | |
Utilities for accessing application information.
|
inlinestatic |
Get the runtime data directory for the current application.
The directory is fixed at the first call this function and will not change for the life of the process.
The directory is read-write for the user that owns the process.
The directory returned depends on file system availability. Specifically, the directory:
This function will create the directory on the first call, if the directory does not already exist.
For Unix type OSes, the directory is "${XDG_RUNTIME_DIR}/appGroup/appName" or "${TMPDIR}/appGroup/appName" or "/tmp/${USER}/appGroup/appName" depending on the existence of the XDG_RUNTIME_DIR and TMPDIR environment variables.
For Windows type OSes, the directory is "GetTempPath() / appGroup / appName".
This function does not implement any logic to handle:
Applications should provide suitable logic to deal with these requirements, including updating file access timestamps every 6 hours and/or setting the sticky bit of each file.
appGroup | the application group name (normally the company name without spaces) |
appName | the application group name (without spaces) |
NotFoundException | if the user config directory could not be located |
|
inlinestatic |
Get the global config directory for the specified application group/name.
The directory is fixed at the first call this function and will not change for the life of the process.
The directory is normally read-only.
For Unix type OSes, the directory is "${PROGRAM_LOCATION}/../share/appGroup/appName/config". For Windows type OSes, the directory is "${PROGRAM_LOCATION}/config".
appGroup | the application group name (normally the company name without spaces) |
appName | the application group name (without spaces) |
NotFoundException | if the user config directory could not be located |
|
inlinestatic |
Get the global data directory for the specified application group/name.
The directory is fixed at the first call this function and will not change for the life of the process.
The directory is normally read-only.
For Unix type OSes, the directory is "${PROGRAM_LOCATION}/../share/appGroup/appName/data". For Windows type OSes, the directory is "${PROGRAM_LOCATION}/data".
appGroup | the application group name (normally the company name without spaces) |
appName | the application group name (without spaces) |
NotFoundException | if the global data directory could not be located |
|
inlinestatic |
Get the user config directory for the specified application group/name.
The directory is fixed at the first call this function and will not change for the life of the process.
The directory is read-write and specific to the user running the process.
For Unix type OSes, the directory is "${XDG_CONFIG_HOME}/appGroup/appName" or "${HOME}/.config/appGroup/appName" if ${XDG_CONFIG_HOME} is not defined.
For Windows type OSes, the directory is "${HOME}/AppData/Roaming/appGroup/appName/config".
appGroup | the application group name (normally the company name without spaces) |
appName | the application group name (without spaces) |
NotFoundException | if the user config directory could not be located |
|
inlinestatic |
Get the user data directory for the specified application group/name.
The directory is fixed at the first call this function and will not change for the life of the process.
The directory is read-write and specific to the user running the process.
For Unix type OSes, the directory is "${XDG_DATA_HOME}/appGroup/appName" or "${HOME}/.local/share/appGroup/appName" if ${XDG_DATA_HOME} is not defined.
For Windows type OSes, the directory is "${HOME}/AppData/Roaming/appGroup/appName/share".
appGroup | the application group name (normally the company name without spaces) |
appName | the application group name (without spaces) |
NotFoundException | if the user data directory could not be located |