RSC
0.17.1
|
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 |
Additional Inherited Members | |
Protected Member Functions inherited from rsc::config::ConfigSource | |
void | splitKeyAtDots (const std::string &input, std::vector< std::string > &output) |
Creates a key vector structure used in the options backend from a dot-separated string. More... | |
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 57 of file ConfigFileSource.cpp.
References getOption(), logger, options, RSCTRACE, and rsc::config::ConfigSource::splitKeyAtDots().
|
private |
Definition at line 93 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 85 of file ConfigFileSource.cpp.
References rsc::config::OptionHandler::handleOption(), and options.
Referenced by rsc::config::processConfigFile(), and 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().