feisty meow concerns codebase
2.140
|
a string_configlet holds onto a character string value. More...
#include <configlet.h>
Public Member Functions | |
string_configlet (const basis::astring §ion, const basis::astring &entry, const basis::astring ¤t_value=basis::astring::empty_string(), const basis::astring &default_value=basis::astring::empty_string()) | |
string_configlet (const string_configlet &to_copy) | |
virtual | ~string_configlet () |
string_configlet & | operator= (const string_configlet &to_copy) |
const basis::astring & | current_value () const |
const basis::astring & | default_value () const |
void | current_value (const basis::astring &new_current) |
void | default_value (const basis::astring &new_default) |
virtual bool | load (configurator &config) |
retrieves the configlet's information from the "config". More... | |
virtual bool | store (configurator &config) const |
writes the configlet's information out to the "config". More... | |
configlet * | duplicate () const |
a virtual copy constructor for configlets. More... | |
Public Member Functions inherited from configuration::configlet | |
configlet (const basis::astring §ion, const basis::astring &entry) | |
creates a configlet that lives in the "section" at the "entry". More... | |
configlet (const configlet &to_copy) | |
virtual | ~configlet () |
DEFINE_CLASS_NAME ("configlet") | |
configlet & | operator= (const configlet &to_copy) |
const basis::astring & | section () const |
observes the section of this configlet. More... | |
const basis::astring & | entry () const |
observes the entry name of this configlet. More... | |
void | section (const basis::astring &new_section) const |
modifies the configlet section location. More... | |
void | entry (const basis::astring &new_entry) const |
modifies the configlet entry name. More... | |
a string_configlet holds onto a character string value.
it has a current value, which could change due to updates to the configuration, and a default value that probably won't change as often. if the "load" operation fails, the default value will be used.
Definition at line 84 of file configlet.h.
configuration::string_configlet::string_configlet | ( | const basis::astring & | section, |
const basis::astring & | entry, | ||
const basis::astring & | current_value = basis::astring::empty_string() , |
||
const basis::astring & | default_value = basis::astring::empty_string() |
||
) |
Definition at line 65 of file configlet.cpp.
Referenced by duplicate().
configuration::string_configlet::string_configlet | ( | const string_configlet & | to_copy | ) |
Definition at line 72 of file configlet.cpp.
|
virtual |
Definition at line 79 of file configlet.cpp.
References basis::WHACK().
const astring & configuration::string_configlet::current_value | ( | ) | const |
Definition at line 94 of file configlet.cpp.
void configuration::string_configlet::current_value | ( | const basis::astring & | new_current | ) |
Definition at line 98 of file configlet.cpp.
const astring & configuration::string_configlet::default_value | ( | ) | const |
Definition at line 96 of file configlet.cpp.
void configuration::string_configlet::default_value | ( | const basis::astring & | new_default | ) |
Definition at line 101 of file configlet.cpp.
|
virtual |
a virtual copy constructor for configlets.
the returned object will be a new copy of this configlet.
Implements configuration::configlet.
Definition at line 117 of file configlet.cpp.
References configuration::configlet::entry(), configuration::configlet::section(), and string_configlet().
|
virtual |
retrieves the configlet's information from the "config".
true is returned when this is successful. note that false is returned if the entry was not originally present; if the configurator has the AUTO_STORE behavior, then we will write out the default value on failure. the next load() would be a success in that case, but would return the default.
Implements configuration::configlet.
Definition at line 104 of file configlet.cpp.
References configuration::configurator::AUTO_STORE, configuration::configurator::behavior(), configuration::configlet::entry(), configuration::configurator::get(), configuration::configurator::put(), and configuration::configlet::section().
string_configlet & configuration::string_configlet::operator= | ( | const string_configlet & | to_copy | ) |
Definition at line 85 of file configlet.cpp.
|
virtual |
writes the configlet's information out to the "config".
Implements configuration::configlet.
Definition at line 114 of file configlet.cpp.
References configuration::configlet::entry(), configuration::configurator::put(), and configuration::configlet::section().