RSC
0.7.17
|
Objects of this class parse streams that contain configuration information in "ini-file" syntax. More...
#include <ConfigFileSource.h>
Public Member Functions | |
ConfigFileSource (std::istream &stream) | |
void | provideOptions (OptionHandler &handler) |
Implementations should pass all configuration options to handler. More... | |
Public Member Functions inherited from rsc::config::ConfigSource | |
virtual | ~ConfigSource () |
Private Member Functions | |
bool | getOption (std::string &name, std::string &value) |
Private Attributes | |
logging::LoggerPtr | logger |
std::istream & | stream |
std::string | currentSection |
std::map< std::vector < std::string >, std::string > | options |
Objects of this class parse streams that contain configuration information in "ini-file" syntax.
Sections and keys are mapped to hierarchical names.
Currently, only files with line encoding styles of the respective platform the code is run on are supported. Others may work but without guarantee.
Definition at line 52 of file ConfigFileSource.h.
rsc::config::ConfigFileSource::ConfigFileSource | ( | std::istream & | stream | ) |
Definition at line 55 of file ConfigFileSource.cpp.
References getOption(), logger, options, and RSCTRACE.
|
private |
Definition at line 82 of file ConfigFileSource.cpp.
References currentSection, stream, and rsc::config::trim().
Referenced by ConfigFileSource().
|
virtual |
Implementations should pass all configuration options to handler.
handler | The handler to which all option should be passed. |
std::invalid_argument | may be thrown when the options this source uses in the background are not well-formated |
Implements rsc::config::ConfigSource.
Definition at line 74 of file ConfigFileSource.cpp.
References rsc::config::OptionHandler::handleOption(), and options.
Referenced by rsc::logging::LoggerFactory::reconfigureFromFile().
|
private |
Definition at line 62 of file ConfigFileSource.h.
Referenced by getOption().
|
private |
Definition at line 59 of file ConfigFileSource.h.
Referenced by ConfigFileSource().
|
private |
Definition at line 64 of file ConfigFileSource.h.
Referenced by ConfigFileSource(), and provideOptions().
|
private |
Definition at line 61 of file ConfigFileSource.h.
Referenced by getOption().