Simple struct providing one static method that reads an environment variable into an ALib string-type.
While under POSIX-compatible operating systems, environment variable names are case-sensitive, under Microsoft windows they are not.
Definition at line 17 of file environment.hpp.
#include <environment.hpp>
Public Static Method Index: | |
| static bool | Get (const CString &varName, AString &target, lang::CurrentData targetData=lang::CurrentData::Clear) |
|
static |
Reads an environment variable into an ALib string.
AString for parameter target, a reference of type Path may be given, which is derived from class AString. However, compatibility of both types depend on the platform and compilation flags of the ALib Build: The character-type of class Path equals C++ standard type std::filesystem::path::value_type, while the one of AString depends on configuration macro ALIB_CHARACTERS_WIDE. On GNU/Linux and MacOS, both default to nchar, on WindowsOS both default to wchar and as such compatibility is given with the defaults. If compilation of ALib is explicitly switched to use a different character type, then conversion has to be performed.| varName | The name of the variable to be retrieved. |
| target | An AString to write the result to. |
| targetData | If CurrentData::Keep, the parameter target is not cleared before the result is written. Defaults to CurrentData::Clear. |
true if variable was found. Definition at line 4 of file environment.cpp.