feisty meow concerns codebase
2.140
|
Represents an atom of configuration info. More...
#include <configlet.h>
Public Member Functions | |
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... | |
virtual bool | load (configurator &config)=0 |
retrieves the configlet's information from the "config". More... | |
virtual bool | store (configurator &config) const =0 |
writes the configlet's information out to the "config". More... | |
virtual configlet * | duplicate () const =0 |
a virtual copy constructor for configlets. More... | |
Represents an atom of configuration info.
The configlet has a location in a configuration repository that is defined by its section and key name. Derived types can also have a value that is stored in that location.
Definition at line 32 of file configlet.h.
configuration::configlet::configlet | ( | const basis::astring & | section, |
const basis::astring & | entry | ||
) |
creates a configlet that lives in the "section" at the "entry".
Definition at line 29 of file configlet.cpp.
configuration::configlet::configlet | ( | const configlet & | to_copy | ) |
Definition at line 34 of file configlet.cpp.
|
virtual |
Definition at line 39 of file configlet.cpp.
References basis::WHACK().
configuration::configlet::DEFINE_CLASS_NAME | ( | "configlet" | ) |
|
pure virtual |
a virtual copy constructor for configlets.
the returned object will be a new copy of this configlet.
Implemented in configuration::bounded_int_configlet, configuration::int_configlet, and configuration::string_configlet.
Referenced by configuration::configuration_list::add().
const astring & configuration::configlet::entry | ( | ) | const |
observes the entry name of this configlet.
Definition at line 55 of file configlet.cpp.
Referenced by configuration::string_configlet::duplicate(), configuration::configuration_list::find(), configuration::string_configlet::load(), configuration::int_configlet::load(), configuration::string_configlet::store(), configuration::int_configlet::store(), and configuration::configuration_list::zap().
void configuration::configlet::entry | ( | const basis::astring & | new_entry | ) | const |
modifies the configlet entry name.
Definition at line 60 of file configlet.cpp.
|
pure 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.
Implemented in configuration::int_configlet, and configuration::string_configlet.
Referenced by configuration::configuration_list::load().
Definition at line 45 of file configlet.cpp.
const astring & configuration::configlet::section | ( | ) | const |
observes the section of this configlet.
Definition at line 53 of file configlet.cpp.
Referenced by configuration::string_configlet::duplicate(), configuration::configuration_list::find(), configuration::string_configlet::load(), configuration::int_configlet::load(), configuration::string_configlet::store(), configuration::int_configlet::store(), and configuration::configuration_list::zap().
void configuration::configlet::section | ( | const basis::astring & | new_section | ) | const |
modifies the configlet section location.
Definition at line 57 of file configlet.cpp.
|
pure virtual |
writes the configlet's information out to the "config".
Implemented in configuration::int_configlet, and configuration::string_configlet.
Referenced by configuration::configuration_list::store().