ORE Studio 0.0.4
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
environment Class Referencefinal

Utilities for reading environment variables. More...

#include <environment.hpp>

Collaboration diagram for environment:
Collaboration graph

Static Public Member Functions

static std::optional< std::string > get_value (const std::string &name)
 Gets an environment variable value.
 
static std::string get_value_or_default (const std::string &name, const std::string &default_value)
 Gets an environment variable value with a default.
 
static int get_int_value_or_default (const std::string &name, int default_value)
 Gets an environment variable value as an integer.
 
static void set_value (const std::string &name, const std::string &value)
 Sets an environment variable value.
 

Detailed Description

Utilities for reading environment variables.

Member Function Documentation

◆ get_value()

std::optional< std::string > get_value ( const std::string &  name)
static

Gets an environment variable value.

Parameters
nameName of the environment variable.
Returns
The value if found, empty optional otherwise.
Here is the caller graph for this function:

◆ get_value_or_default()

std::string get_value_or_default ( const std::string &  name,
const std::string &  default_value 
)
static

Gets an environment variable value with a default.

Parameters
nameName of the environment variable.
default_valueDefault value if not found.
Returns
The value if found, default_value otherwise.

◆ get_int_value_or_default()

int get_int_value_or_default ( const std::string &  name,
int  default_value 
)
static

Gets an environment variable value as an integer.

Parameters
nameName of the environment variable.
default_valueDefault value if not found or not parseable.
Returns
The value if found and parseable, default_value otherwise.

◆ set_value()

void set_value ( const std::string &  name,
const std::string &  value 
)
static

Sets an environment variable value.

Parameters
nameName of the environment variable.
valueValue to set.
Here is the caller graph for this function: