feisty meow concerns codebase
2.140
|
Supports the configurator interface using a collection of string tables. More...
#include <table_configurator.h>
Public Member Functions | |
table_configurator (treatment_of_defaults behavior=AUTO_STORE) | |
Constructor just needs to know what to do for missing items. More... | |
table_configurator (const table_configurator &to_copy) | |
virtual | ~table_configurator () |
table_configurator & | operator= (const table_configurator &to_copy) |
DEFINE_CLASS_NAME ("table_configurator") | |
virtual void | sections (structures::string_array &list) |
retrieves the section names into "list". More... | |
void | reset () |
virtual bool | get (const basis::astring §ion, const basis::astring &entry, basis::astring &found) |
implements the configurator retrieval function. More... | |
virtual bool | put (const basis::astring §ion, const basis::astring &entry, const basis::astring &to_store) |
implements the configurator storage function. More... | |
virtual bool | section_exists (const basis::astring §ion) |
true if the "section" is presently in the table config. More... | |
virtual bool | delete_section (const basis::astring §ion) |
removes the entire "section" specified. More... | |
virtual bool | delete_entry (const basis::astring §ion, const basis::astring &entry) |
removes the entry specified by the "section" and "entry" name. More... | |
virtual bool | get_section (const basis::astring §ion, structures::string_table &info) |
reads the entire table held under "section" into a table called "info". More... | |
virtual bool | put_section (const basis::astring §ion, const structures::string_table &info) |
writes a table called "info" into the "section" held here. More... | |
Public Member Functions inherited from configuration::configurator | |
configurator (treatment_of_defaults behavior=RETURN_ONLY) | |
virtual | ~configurator () |
treatment_of_defaults | behavior () const |
observes the behavior chosen for the load() function. More... | |
void | behavior (treatment_of_defaults new_behavior) |
modifies the behavior of the load() function. More... | |
bool | store (const basis::astring §ion, const basis::astring &entry, const basis::astring &to_store) |
a synonym for put. More... | |
basis::astring | load (const basis::astring §ion, const basis::astring &entry, const basis::astring &default_value) |
a synonym for get that implements the auto-store behavior. More... | |
bool | store (const basis::astring §ion, const basis::astring &entry, int value) |
stores an integer value from the configuration store. More... | |
int | load (const basis::astring §ion, const basis::astring &entry, int def_value) |
loads an integer value from the configuration store. More... | |
void | section_set (structures::string_set &list) |
similar to above, but stores section names into a set. More... | |
virtual bool | delete_entry (const basis::astring &formal(section), const basis::astring &formal(entry)) |
eliminates the entry specified by the "section" and "entry" name. More... | |
virtual bool | delete_section (const basis::astring &formal(section)) |
whacks the entire "section" specified. More... | |
virtual bool | get_section (const basis::astring &formal(section), structures::string_table &formal(found)) |
retrieves an entire "section", if supported by the derived object. More... | |
virtual bool | put_section (const basis::astring &formal(section), const structures::string_table &formal(to_store)) |
stores an entire "section" from the table in "to_store", if supported. More... | |
Additional Inherited Members | |
Public Types inherited from configuration::configurator | |
enum | treatment_of_defaults { AUTO_STORE , RETURN_ONLY } |
Supports the configurator interface using a collection of string tables.
Definition at line 29 of file table_configurator.h.
configuration::table_configurator::table_configurator | ( | treatment_of_defaults | behavior = AUTO_STORE | ) |
Constructor just needs to know what to do for missing items.
Creates a table_configurator that loads and stores entries into the internal collection of tables. It will use the "behavior" regarding missing entries when load() is invoked.
Definition at line 37 of file table_configurator.cpp.
configuration::table_configurator::table_configurator | ( | const table_configurator & | to_copy | ) |
Definition at line 42 of file table_configurator.cpp.
|
virtual |
Definition at line 47 of file table_configurator.cpp.
References basis::WHACK().
configuration::table_configurator::DEFINE_CLASS_NAME | ( | "table_configurator" | ) |
|
virtual |
removes the entry specified by the "section" and "entry" name.
Definition at line 85 of file table_configurator.cpp.
References structures::symbol_table< contents >::whack().
Referenced by put().
|
virtual |
removes the entire "section" specified.
Definition at line 82 of file table_configurator.cpp.
Referenced by put().
|
virtual |
implements the configurator retrieval function.
Implements configuration::configurator.
Definition at line 108 of file table_configurator.cpp.
References structures::symbol_table< contents >::find().
Referenced by configuration::config_watcher::changed_items().
|
virtual |
reads the entire table held under "section" into a table called "info".
Definition at line 170 of file table_configurator.cpp.
References structures::symbol_table< contents >::add(), FUNCDEF, structures::symbol_table< contents >::name(), structures::symbol_table< contents >::reset(), and structures::symbol_table< contents >::symbols().
Referenced by configuration::config_watcher::changed_items(), configuration::config_watcher::changed_sections(), configuration::config_watcher::deleted_items(), configuration::config_watcher::new_items(), and configuration::ini_parser::restate().
table_configurator & configuration::table_configurator::operator= | ( | const table_configurator & | to_copy | ) |
Definition at line 52 of file table_configurator.cpp.
References basis::array< contents >::length().
|
virtual |
implements the configurator storage function.
Implements configuration::configurator.
Definition at line 93 of file table_configurator.cpp.
References structures::symbol_table< contents >::add(), delete_entry(), delete_section(), and basis::astring::length().
Referenced by configuration::ini_parser::merge_section().
|
virtual |
writes a table called "info" into the "section" held here.
Definition at line 182 of file table_configurator.cpp.
References FUNCDEF.
Referenced by configuration::ini_parser::merge_section(), and configuration::config_watcher::rescan().
void configuration::table_configurator::reset | ( | ) |
Definition at line 70 of file table_configurator.cpp.
Referenced by configuration::ini_parser::ini_parser(), configuration::config_watcher::rescan(), and configuration::ini_parser::reset().
|
virtual |
true if the "section" is presently in the table config.
Reimplemented from configuration::configurator.
Definition at line 72 of file table_configurator.cpp.
Referenced by configuration::ini_parser::merge_section().
|
virtual |
retrieves the section names into "list".
Reimplemented from configuration::configurator.
Definition at line 75 of file table_configurator.cpp.
References basis::array< contents >::reset().
Referenced by configuration::ini_parser::restate().