#include <config-file.hpp>
Classes | |
class | Error |
Public Member Functions | |
ConfigFile (UnknownConfigSectionHandler unknownSectionCallback=throwErrorOnUnknownSection) | |
void | addSectionHandler (const std::string §ionName, ConfigSectionHandler subscriber) |
setup notification of configuration file sections More... | |
void | parse (const std::string &filename, bool isDryRun) |
void | parse (const std::string &input, bool isDryRun, const std::string &filename) |
void | parse (std::istream &input, bool isDryRun, const std::string &filename) |
void | parse (const ConfigSection &config, bool isDryRun, const std::string &filename) |
Static Public Member Functions | |
static void | throwErrorOnUnknownSection (const std::string &filename, const std::string §ionName, const ConfigSection §ion, bool isDryRun) |
static void | ignoreUnknownSection (const std::string &filename, const std::string §ionName, const ConfigSection §ion, bool isDryRun) |
static bool | parseYesNo (const ConfigSection::value_type &option, const std::string §ionName) |
parse a config option that can be either "yes" or "no" More... | |
template<typename T > | |
static std::enable_if< std::is_arithmetic< T >::value, T >::type | parseNumber (const ConfigSection::value_type &option, const std::string §ionName) |
parse a numeric (integral or floating point) config option More... | |
Definition at line 48 of file config-file.hpp.
|
explicit |
Definition at line 34 of file config-file.cpp.
Referenced by nfd::ConfigFile::Error::Error().
|
static |
Definition at line 40 of file config-file.cpp.
Referenced by nfd::ConfigFile::Error::Error(), nfd::ignoreRibAndLogSections(), nfd::rib::Nrd::initialize(), and ns3::ndn::IgnoreSections::operator()().
|
static |
Definition at line 53 of file config-file.cpp.
Referenced by nfd::ConfigFile::Error::Error(), nfd::rib::Nrd::initialize(), nfd::Nfd::initialize(), and nfd::Nfd::reloadConfigFile().
|
static |
parse a config option that can be either "yes" or "no"
Error | the value is neither "yes" nor "no" |
Definition at line 62 of file config-file.cpp.
Referenced by nfd::ConfigFile::Error::Error(), and nfd::FaceManager::setConfigFile().
|
inlinestatic |
parse a numeric (integral or floating point) config option
Error | the value cannot be converted to the specified type |
Definition at line 151 of file config-file.hpp.
References nfd::ConfigFile::Error::Error().
Referenced by nfd::ConfigFile::Error::Error().
void nfd::ConfigFile::addSectionHandler | ( | const std::string & | sectionName, |
ConfigSectionHandler | subscriber | ||
) |
setup notification of configuration file sections
Definition at line 79 of file config-file.cpp.
Referenced by nfd::ConfigFile::Error::Error(), nfd::CommandValidator::setConfigFile(), nfd::FaceManager::setConfigFile(), nfd::TablesConfigSection::setConfigFile(), nfd::rib::RibManager::setConfigFile(), and nfd::general::setConfigFile().
void nfd::ConfigFile::parse | ( | const std::string & | filename, |
bool | isDryRun | ||
) |
filename | file to parse |
isDryRun | true if performing a dry run of configuration, false otherwise |
ConfigFile::Error | if file not found |
ConfigFile::Error | if parse error |
Definition at line 86 of file config-file.cpp.
Referenced by nfd::ConfigFile::Error::Error(), nfd::ignoreRibAndLogSections(), nfd::rib::Nrd::initialize(), nfd::Nfd::initialize(), parse(), nfd::Nfd::reloadConfigFile(), and ns3::ndn::L3Protocol::setCsReplacementPolicy().
void nfd::ConfigFile::parse | ( | const std::string & | input, |
bool | isDryRun, | ||
const std::string & | filename | ||
) |
input | configuration (as a string) to parse |
isDryRun | true if performing a dry run of configuration, false otherwise |
filename | logical filename of the config file, can appear in error messages |
ConfigFile::Error | if file not found |
ConfigFile::Error | if parse error |
Definition at line 101 of file config-file.cpp.
References parse().
void nfd::ConfigFile::parse | ( | std::istream & | input, |
bool | isDryRun, | ||
const std::string & | filename | ||
) |
input | stream to parse |
isDryRun | true if performing a dry run of configuration, false otherwise |
filename | logical filename of the config file, can appear in error messages |
ConfigFile::Error | if parse error |
Definition at line 108 of file config-file.cpp.
void nfd::ConfigFile::parse | ( | const ConfigSection & | config, |
bool | isDryRun, | ||
const std::string & | filename | ||
) |
config | ConfigSection that needs to be processed |
isDryRun | true if performing a dry run of configuration, false otherwise |
filename | logical filename of the config file, can appear in error messages |
ConfigFile::Error | if parse error |
Definition at line 127 of file config-file.cpp.