libnick 2024.12.0
A cross-platform base for native Nickvision applications.
|
Functions | |
constexpr OperatingSystem | getOperatingSystem () |
Gets the current operating system. | |
DeploymentMode | getDeploymentMode () |
Gets the current deployment mode. | |
const std::filesystem::path & | getExecutableDirectory () |
Gets the path of the executable's directory. | |
std::string | getLocaleName () |
Gets the name of the current locale. | |
bool | hasVariable (const std::string &key) |
Checks if an environment variable exists. | |
std::string | getVariable (const std::string &key) |
Gets the value of an environment variable. | |
bool | setVariable (const std::string &key, const std::string &value) |
Sets the value of an environment variable. | |
bool | clearVariable (const std::string &key) |
Clears an environment variable. | |
bool | testVariable (const std::string &key) |
Tests an environment variable value to see if it is true. | |
std::vector< std::filesystem::path > | getPath () |
Gets a list of directories from the system PATH variable. | |
std::string | exec (const std::string &cmd) |
Executes a command in the system shell. | |
const std::filesystem::path & | findDependency (std::string dependency) |
Finds the path of a given executable dependency in the system. | |
std::string | getDebugInformation (const App::AppInfo &appInfo, const std::string &extraInformation="") |
Gets a debug information string about the user's environment. | |
bool Nickvision::System::Environment::clearVariable | ( | const std::string & | key | ) |
Clears an environment variable.
key | The environment variable to delete |
std::string Nickvision::System::Environment::exec | ( | const std::string & | cmd | ) |
Executes a command in the system shell.
cmd | The command to execute |
const std::filesystem::path & Nickvision::System::Environment::findDependency | ( | std::string | dependency | ) |
Finds the path of a given executable dependency in the system.
The current executable's directory is searched first, then the system's PATH.
Windows UWP (Store) apps are not supported.
dependency | The name of the executable dependency to find |
std::string Nickvision::System::Environment::getDebugInformation | ( | const App::AppInfo & | appInfo, |
const std::string & | extraInformation = "" ) |
Gets a debug information string about the user's environment.
appInfo The application's AppInfo
extraInformation Extra information to append to the end of the debug information string
DeploymentMode Nickvision::System::Environment::getDeploymentMode | ( | ) |
Gets the current deployment mode.
const std::filesystem::path & Nickvision::System::Environment::getExecutableDirectory | ( | ) |
Gets the path of the executable's directory.
std::string Nickvision::System::Environment::getLocaleName | ( | ) |
Gets the name of the current locale.
|
constexpr |
Gets the current operating system.
std::vector< std::filesystem::path > Nickvision::System::Environment::getPath | ( | ) |
Gets a list of directories from the system PATH variable.
std::string Nickvision::System::Environment::getVariable | ( | const std::string & | key | ) |
Gets the value of an environment variable.
key | The environment variable to get |
bool Nickvision::System::Environment::hasVariable | ( | const std::string & | key | ) |
Checks if an environment variable exists.
key | The environment variable to check |
bool Nickvision::System::Environment::setVariable | ( | const std::string & | key, |
const std::string & | value ) |
Sets the value of an environment variable.
key | The environment variable to set |
value | The value for the environment variable |
bool Nickvision::System::Environment::testVariable | ( | const std::string & | key | ) |
Tests an environment variable value to see if it is true.
A true value is one that is "true", "t", "yes", "y", or "1".
key | The environment variable to test |