diff --git a/include/transport/config.h b/include/transport/config.h index 4ced7c987d1a66bccc3504c77c7e636bc76a2e84..dd76bc7be81a0c43f77075b863bb76b75d83ebfc 100644 --- a/include/transport/config.h +++ b/include/transport/config.h @@ -35,6 +35,9 @@ #define CONFIG_LIST(PTR, KEY) (*PTR)[KEY].as >() #define CONFIG_VECTOR(PTR, KEY) ((*PTR).hasKey(KEY) ? (*PTR)[KEY].as >() : std::vector()) +#define CONFIG_STRING_DEFAULTED(PTR, KEY, DEF) ((*PTR).hasKey(KEY) ? (*PTR)[KEY].as() : DEF) +#define CONFIG_BOOL_DEFAULTED(PTR, KEY, DEF) ((*PTR).hasKey(KEY) ? (*PTR)[KEY].as() : DEF) + namespace Transport { @@ -49,6 +52,9 @@ typedef boost::program_options::variables_map Variables; /// class documentation to get a list of all relevant variables for that class. class Config { public: + typedef std::map SectionValuesCont; + typedef std::map UnregisteredCont; + /// Constructor. Config(int argc = 0, char **argv = NULL) : m_argc(argc), m_argv(argv) {} @@ -91,6 +97,10 @@ class Config { return m_unregistered[key]; } + SectionValuesCont getSectionValues(const std::string& sectionName); + + std::string getCommandLineArgs() const; + /// Returns path to config file from which data were loaded. const std::string &getConfigFile() { return m_file; }