feisty meow concerns codebase
2.140
|
Stores a simple integer in a configuration repository. More...
#include <configlet.h>
Public Member Functions | |
int_configlet (const basis::astring §ion, const basis::astring &entry, int current_value=0, int default_value=0) | |
virtual | ~int_configlet () |
int | current_value () const |
virtual void | current_value (int new_current) |
the modifier function is virtual so derived classes can extend. More... | |
int | default_value () const |
void | default_value (int 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... | |
Stores a simple integer in a configuration repository.
Definition at line 115 of file configlet.h.
configuration::int_configlet::int_configlet | ( | const basis::astring & | section, |
const basis::astring & | entry, | ||
int | current_value = 0 , |
||
int | default_value = 0 |
||
) |
Definition at line 122 of file configlet.cpp.
Referenced by duplicate().
|
virtual |
Definition at line 130 of file configlet.cpp.
|
inline |
Definition at line 122 of file configlet.h.
Referenced by configuration::bounded_int_configlet::current_value(), and load().
|
virtual |
the modifier function is virtual so derived classes can extend.
Reimplemented in configuration::bounded_int_configlet.
Definition at line 132 of file configlet.cpp.
|
inline |
Definition at line 127 of file configlet.h.
Referenced by configuration::bounded_int_configlet::current_value().
|
inline |
Definition at line 128 of file configlet.h.
|
virtual |
a virtual copy constructor for configlets.
the returned object will be a new copy of this configlet.
Implements configuration::configlet.
Reimplemented in configuration::bounded_int_configlet.
Definition at line 148 of file configlet.cpp.
References int_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 135 of file configlet.cpp.
References current_value(), configuration::configlet::entry(), configuration::configurator::get(), configuration::configurator::load(), and configuration::configlet::section().
|
virtual |
writes the configlet's information out to the "config".
Implements configuration::configlet.
Definition at line 145 of file configlet.cpp.
References configuration::configlet::entry(), configuration::configlet::section(), and configuration::configurator::store().