#include <platformstl/system/environment_map.hpp>
Member Types | |
typedef string_type | first_type |
The string type used for variable name, and lookup. | |
typedef string_type | second_type |
The string type used for variable value, and retrieval. | |
typedef std::pair< const first_type, second_type > | value_type |
Value type of the class: a pair of first_type and second_type. | |
typedef size_t | size_type |
The size type. | |
typedef ss_ptrdiff_t | difference_type |
The difference type. | |
typedef const value_type | const_reference |
The non-mutating (const) reference type. | |
typedef environment_map | class_type |
The type of the class. | |
Public Member Functions | |
Construction | |
environment_map () | |
Constructs an instance of the type. | |
Element Access | |
second_type | operator[] (char const *name) const |
Returns the value of the given environment variable, or throws std::out_of_range if it does not exist. | |
second_type | operator[] (first_type const &name) const |
Returns the value of the given environment variable, or throws std::out_of_range if it does not exist. | |
bool | lookup (char const *name, second_type &value) const |
Looks for the variable of the given name in the current process environment. | |
bool | lookup (first_type const &name, second_type &value) const |
Looks for the variable of the given name in the current process environment. | |
Operations | |
void | refresh () |
Discard any current enumeration snapshots. | |
Classes | |
class | snapshot |
typedef string_type first_type |
The string type used for variable name, and lookup.
typedef string_type second_type |
The string type used for variable value, and retrieval.
typedef std::pair< const first_type , second_type > value_type |
Value type of the class: a pair of first_type and second_type.
typedef size_t size_type |
The size type.
typedef ss_ptrdiff_t difference_type |
The difference type.
typedef const value_type const_reference |
The non-mutating (const) reference type.
typedef environment_map class_type |
The type of the class.
environment_map | ( | ) |
Constructs an instance of the type.
second_type operator[] | ( | char const * | name | ) | const |
Returns the value of the given environment variable, or throws std::out_of_range if it does not exist.
name | The name of the environment variable whose value is to be retrieved |
std::out_of_range | If no variable exists with the given name |
second_type operator[] | ( | first_type const & | name | ) | const |
Returns the value of the given environment variable, or throws std::out_of_range if it does not exist.
name | The name of the environment variable whose value is to be retrieved |
std::out_of_range | If no variable exists with the given name |
bool lookup | ( | char const * | name, | |
second_type & | value | |||
) | const |
Looks for the variable of the given name in the current process environment.
bool lookup | ( | first_type const & | name, | |
second_type & | value | |||
) | const |
Looks for the variable of the given name in the current process environment.
void refresh | ( | ) |
Discard any current enumeration snapshots.
Used to force the collection instance to discard any currently snapshotd snapshot it may be holding on behalf of extant iterator instances, so that new iterator instances will receive a refreshed view of the underlying environment.