1 #ifndef CONFIGPARSER_HPP_ 2 #define CONFIGPARSER_HPP_ 4 #include "io/Configuration.hpp" 31 ConfigParser(std::istream &configStream,
bool allowUnrecognizedArguments);
45 return mConfig.getBooleanArgument(name);
55 return mConfig.getIntegerArgument(name);
65 return mConfig.getUnsignedIntArgument(name);
75 return mConfig.getStringArgument(name);
85 return mConfig.getIntOptionalArgument(name);
93 std::string
printConfig()
const {
return mConfig.printConfig(); }
95 static std::string createString(
96 bool requireReturnFlag,
97 std::string
const &outputPath,
98 std::string
const ¶msFile,
99 std::string
const &logFile,
100 std::string
const &gpuDevices,
101 unsigned int randomSeed,
102 std::string
const &workingDir,
104 std::string
const &checkpointReadDir,
105 bool useDefaultNumThreads,
152 void initialize(std::istream &inputStream,
bool allowUnrecognizedArguments);
158 void handleUnrecognized(std::string
const &argument, std::string
const &value,
int linenumber);
168 bool mAllowUnrecognizedArguments =
false;
174 #endif // CONFIGPARSER_HPP_ ConfigParser(std::istream &configStream, bool allowUnrecognizedArguments)
unsigned int const & getUnsignedIntArgument(std::string const &name) const
void initialize(std::istream &inputStream, bool allowUnrecognizedArguments)
bool const & getBooleanArgument(std::string const &name) const
int const & getIntegerArgument(std::string const &name) const
std::string printConfig() const
bool getAllowUnrecognizedArguments() const
std::string getStringArgument(std::string const &name) const
Configuration const & getConfig() const
Configuration::IntOptional getIntOptionalArgument(std::string const &name) const
std::string stripLeadingTrailingWhitespace(std::string const &inString)
void handleUnrecognized(std::string const &argument, std::string const &value, int linenumber)