libnick 2024.12.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
environment.h File Reference
#include <filesystem>
#include <string>
#include <vector>
#include "app/appinfo.h"
#include "deploymentmode.h"
#include "operatingsystem.h"

Go to the source code of this file.

Namespaces

namespace  Nickvision
 
namespace  Nickvision::System
 
namespace  Nickvision::System::Environment
 

Functions

constexpr OperatingSystem Nickvision::System::Environment::getOperatingSystem ()
 Gets the current operating system.
 
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.
 
bool Nickvision::System::Environment::hasVariable (const std::string &key)
 Checks if an environment variable exists.
 
std::string Nickvision::System::Environment::getVariable (const std::string &key)
 Gets the value of an environment variable.
 
bool Nickvision::System::Environment::setVariable (const std::string &key, const std::string &value)
 Sets the value of an environment variable.
 
bool Nickvision::System::Environment::clearVariable (const std::string &key)
 Clears an environment variable.
 
bool Nickvision::System::Environment::testVariable (const std::string &key)
 Tests an environment variable value to see if it is true.
 
std::vector< std::filesystem::path > Nickvision::System::Environment::getPath ()
 Gets a list of directories from the system PATH variable.
 
std::string Nickvision::System::Environment::exec (const std::string &cmd)
 Executes a command in the system shell.
 
const std::filesystem::path & Nickvision::System::Environment::findDependency (std::string dependency)
 Finds the path of a given executable dependency in the system.
 
std::string Nickvision::System::Environment::getDebugInformation (const App::AppInfo &appInfo, const std::string &extraInformation="")
 Gets a debug information string about the user's environment.
 

Detailed Description

Author
Nicholas Logozzo nlogo.nosp@m.zzo2.nosp@m.25@gm.nosp@m.ail..nosp@m.com

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at https://www.gnu.org/copyleft/gpl.html

DESCRIPTION

Functions for working with the system's shell and environment.