24 #include <config/config.h>
25 #include <config/change_handler.h>
332 append(
"%s: %s", prefix, msg);
345 :
Exception(
"Config value for '%s' not found", path)
362 const char *requested)
365 append(
"Config value for '%s' is not of type '%s', but of type '%s'",
366 path, requested, actual);
381 va_start(va, format);
507 for (ChangeHandlerMultimap::iterator i =
_ch_range.first; !changed && (i !=
_ch_range.second); ++i) {
508 if ( (*i).second == h ) {
529 if ( strstr(path, (*j).first) == path ) {
531 for (ChangeHandlerMultimap::const_iterator i =
_ch_range.first; i !=
_ch_range.second; ++i) {
532 rv->push_back((*i).second);
552 for (ChangeHandlerList::const_iterator i = h->begin(); i != h->end(); ++i) {
553 if (comment_changed) {
554 (*i)->config_comment_changed(value);
556 (*i)->config_value_changed(value);
560 for (ChangeHandlerList::const_iterator i = h->begin(); i != h->end(); ++i) {
561 (*i)->config_value_erased(path);
ChangeHandlerMultimapRange _ch_range
Change handler range.
ChangeHandlerMultimap _change_handlers
Registered change handlers.
Fawkes library namespace.
Interface for configuration change handling.
virtual bool next()=0
Check if there is another element and advance to this if possible.
Base class for exceptions in Fawkes.
ChangeHandlerList * find_handlers(const char *path)
Find handlers for given path.
ConfigTypeMismatchException(const char *path, const char *actual, const char *requested)
Constructor.
virtual void rem_change_handler(ConfigurationChangeHandler *h)
Remove a configuration change handler.
void append_va(const char *format, va_list va)
Append messages to the message list.
ConfigurationException(const char *msg)
Constructor.
void notify_handlers(const char *path, bool comment_changed=false)
Notify handlers for given path.
CouldNotOpenConfigException(const char *format,...)
Constructor.
virtual ValueIterator * get_value(const char *path)=0
Get value from configuration.
Iterator interface to iterate over config values.
virtual void add_change_handler(ConfigurationChangeHandler *h)
Add a configuration change handler.
const char * config_monitor_prefix()
Which path prefix shall be monitored.
void append(const char *format,...)
Append messages to the message list.
ConfigEntryNotFoundException(const char *path)
Constructor.
std::list< ConfigurationChangeHandler * > ChangeHandlerList
List that contains pointers to ConfigurationChangeHandler.