#include <sbuild-environment.h>
Inheritance diagram for sbuild::environment:
Public Member Functions | |
environment () | |
The constructor. | |
environment (char **environment) | |
The constructor. | |
~environment () | |
The destructor. | |
void | add (char **environment) |
Add environment variables. | |
void | add (environment const &environment) |
Add environment variables. | |
void | add (value_type const &value) |
Add environment variable. | |
void | add (std::string const &name, std::string const &value) |
Add environment variable. | |
template<typename T> | |
void | add (std::string const &name, T const &value) |
Add environment variable. | |
void | add (std::string const &value) |
Add environment variable. | |
void | remove (char **environment) |
Remove environment variables. | |
void | remove (environment const &environment) |
Remove environment variables. | |
void | remove (std::string const &value) |
Remove environment variable. | |
void | remove (value_type const &value) |
Remove environment variable. | |
template<typename T> | |
bool | get (std::string const &name, T &value) |
Get the value of an environment variable. | |
char ** | get_strv () const |
Get the evironment variables as a string vector. | |
template<typename T> | |
environment & | operator+= (T &rhs) |
Add variables to the environment. | |
template<typename T> | |
environment & | operator-= (T &rhs) |
Remove variables from the environment. | |
Friends | |
template<typename T> | |
environment | operator+ (environment const &lhs, T const &rhs) |
Add variables to the environment. | |
template<typename T> | |
environment | operator- (environment const &lhs, T const &rhs) |
Remove variables from the environment. | |
template<class charT, class traits> | |
std::basic_ostream< charT, traits > & | operator<< (std::basic_ostream< charT, traits > &stream, environment const &rhs) |
Output the environment to an ostream. |
environment::environment | ( | ) |
The constructor.
environment::environment | ( | char ** | environment | ) |
The constructor.
environment | the environment to set. |
environment::~environment | ( | ) |
The destructor.
void environment::add | ( | std::string const & | value | ) |
Add environment variable.
Any existing variable sharing the name will be replaced.
value | the environment variable to add. This is a string in the form key=value. |
void sbuild::environment::add | ( | std::string const & | name, | |
T const & | value | |||
) | [inline] |
Add environment variable.
Any existing variable sharing the name will be replaced.
name | the environment variable name | |
value | the environment variable value to add. |
Here is the call graph for this function:
void sbuild::environment::add | ( | std::string const & | name, | |
std::string const & | value | |||
) | [inline] |
Add environment variable.
Any existing variable sharing the name will be replaced.
name | the environment variable name | |
value | the environment variable value to add. |
Here is the call graph for this function:
void environment::add | ( | value_type const & | value | ) |
Add environment variable.
Any existing variable sharing the name will be replaced.
value | the environment variable to add. |
void environment::add | ( | environment const & | environment | ) |
Add environment variables.
Any existing variables sharing the name of a new value will be replaced.
environment | the environment variables to add. |
void environment::add | ( | char ** | environment | ) |
Add environment variables.
Any existing variables sharing the name of a new value will be replaced.
environment | the environment variables to add. This is a null-terminated array of pointers to char. |
Here is the caller graph for this function:
bool sbuild::environment::get | ( | std::string const & | name, | |
T & | value | |||
) | [inline] |
Get the value of an environment variable.
name | the name of the environment variable. | |
value | the variable to store the value in on success. |
Here is the call graph for this function:
char ** environment::get_strv | ( | ) | const |
Get the evironment variables as a string vector.
This form is suitable for use as an envp argument with execve, for example.
environment& sbuild::environment::operator+= | ( | T & | rhs | ) | [inline] |
Add variables to the environment.
rhs | the values to add. |
Here is the call graph for this function:
environment& sbuild::environment::operator-= | ( | T & | rhs | ) | [inline] |
Remove variables from the environment.
rhs | the values to remove. |
Here is the call graph for this function:
void environment::remove | ( | value_type const & | value | ) |
Remove environment variable.
Any variable sharing the name of the specified value will be removed.
value | the environment variable to remove. |
void environment::remove | ( | std::string const & | value | ) |
Remove environment variable.
Any variable sharing the name of the specified value will be removed.
value | the environment variable to remove. |
void environment::remove | ( | environment const & | environment | ) |
Remove environment variables.
Any variables sharing the names of a specified value will be removed.
environment | the environment variables to remove. |
void environment::remove | ( | char ** | environment | ) |
Remove environment variables.
Any variables sharing the names of a specified value will be removed.
environment | the environment variables to remove. This is a null-terminated array of pointers to char. |
Here is the caller graph for this function:
environment operator+ | ( | environment const & | lhs, | |
T const & | rhs | |||
) | [friend] |
Add variables to the environment.
lhs | the environment to add to. | |
rhs | the values to add. |
environment operator- | ( | environment const & | lhs, | |
T const & | rhs | |||
) | [friend] |
Remove variables from the environment.
lhs | the environment to remove from. | |
rhs | the values to remove. |
std::basic_ostream<charT,traits>& operator<< | ( | std::basic_ostream< charT, traits > & | stream, | |
environment const & | rhs | |||
) | [friend] |
Output the environment to an ostream.
stream | the stream to output to. | |
rhs | the environment to output. |