feisty meow concerns codebase  2.140
basis::environment Class Reference

Provides access to the system's environment variables. More...

#include <environment.h>

Inheritance diagram for basis::environment:
Collaboration diagram for basis::environment:

Static Public Member Functions

static astring TMP ()
 provides a single place to get the temporary directory. More...
 
static astring get (const astring &variable_name)
 looks up the "variable_name" in the current environment variables. More...
 
static bool set (const astring &variable_name, const astring &value)
 adds or creates "variable_name" in the environment. More...
 
static basis::un_int system_uptime ()
 gives the operating system's uptime in a small form that rolls over. More...
 

Detailed Description

Provides access to the system's environment variables.

Definition at line 26 of file environment.h.

Member Function Documentation

◆ get()

astring basis::environment::get ( const astring variable_name)
static

looks up the "variable_name" in the current environment variables.

this returns the value for "variable_name" as it was found in the operating system's environment variables that are defined at this point in time for the user and process. the returned string will be empty if no variable under that name could be found.

Definition at line 57 of file environment.cpp.

References basis::astring::observe().

Referenced by main(), configuration::ini_configurator::name(), textual::parser_bits::substitute_env_vars(), and TMP().

◆ set()

bool basis::environment::set ( const astring variable_name,
const astring value 
)
static

adds or creates "variable_name" in the environment.

changes the current set of environment variables by adding or modifying the "variable_name". its new value will be "value".

Definition at line 72 of file environment.cpp.

References basis::astring::s().

Referenced by TMP().

◆ system_uptime()

basis::un_int basis::environment::system_uptime ( )
static

gives the operating system's uptime in a small form that rolls over.

Definition at line 84 of file environment.cpp.

Referenced by mathematics::chaos::retrain().

◆ TMP()

astring basis::environment::TMP ( )
static

provides a single place to get the temporary directory.

this will locate the value of the TMP variable and return it. if the TMP variable is not currently defined, this will try to do something reasonable for a default value.

Definition at line 39 of file environment.cpp.

References get(), and set().

Referenced by configuration::application_configuration::get_cmdline_from_proc(), configuration::application_configuration::get_logging_directory(), and main().


The documentation for this class was generated from the following files: