presage
0.8.7
|
#include <variable.h>
Public Member Functions | |
Variable (const char *variable) | |
Variable (const std::string &variable) | |
Variable (const std::vector< std::string > &variable) | |
~Variable () | |
std::string | get_name () const |
std::vector< std::string > | get_name_vector () const |
std::string | get_value () const |
void | set_value (std::string value) |
size_t | size () const |
bool | operator< (const Variable &other) const |
Static Public Member Functions | |
static std::vector< std::string > | string_to_vector (const std::string &str) |
static std::string | vector_to_string (const std::vector< std::string > &var) |
Private Attributes | |
std::string | m_name |
std::vector< std::string > | m_name_vector |
std::string | m_value |
Definition at line 33 of file variable.h.
Variable::Variable | ( | const char * | variable | ) |
Definition at line 29 of file variable.cpp.
References m_name, m_name_vector, and string_to_vector().
Variable::Variable | ( | const std::string & | variable | ) |
Definition at line 35 of file variable.cpp.
References m_name, m_name_vector, and string_to_vector().
Variable::Variable | ( | const std::vector< std::string > & | variable | ) |
Definition at line 41 of file variable.cpp.
References m_name, m_name_vector, and vector_to_string().
Definition at line 47 of file variable.cpp.
std::string Variable::get_name | ( | ) | const [virtual] |
Implements Observable.
Definition at line 52 of file variable.cpp.
References m_name.
Referenced by operator<().
std::vector< std::string > Variable::get_name_vector | ( | ) | const |
Definition at line 57 of file variable.cpp.
References m_name_vector.
std::string Variable::get_value | ( | ) | const [virtual] |
Implements Observable.
Definition at line 62 of file variable.cpp.
References m_value.
Referenced by ProfileManager::refresh_config(), and ProfileManager::~ProfileManager().
bool Variable::operator< | ( | const Variable & | other | ) | const [inline] |
Definition at line 48 of file variable.h.
References get_name().
void Variable::set_value | ( | std::string | value | ) |
Definition at line 67 of file variable.cpp.
References m_value, and Observable::notify().
Referenced by Configuration::insert().
size_t Variable::size | ( | ) | const [inline] |
Definition at line 46 of file variable.h.
References m_name_vector.
std::vector< std::string > Variable::string_to_vector | ( | const std::string & | str | ) | [static] |
Tokenize string on '.' char
foo.bar.foobar
|foo|bar|foobar|
Definition at line 82 of file variable.cpp.
Referenced by Profile::read_from_configuration(), and Variable().
std::string Variable::vector_to_string | ( | const std::vector< std::string > & | var | ) | [static] |
Definition at line 131 of file variable.cpp.
Referenced by Variable(), and Profile::visit_node().
std::string Variable::m_name [private] |
Definition at line 55 of file variable.h.
Referenced by get_name(), and Variable().
std::vector<std::string> Variable::m_name_vector [private] |
Definition at line 56 of file variable.h.
Referenced by get_name_vector(), size(), and Variable().
std::string Variable::m_value [private] |
Definition at line 57 of file variable.h.
Referenced by get_value(), and set_value().