1 #ifndef CONFIGURATION_HPP_ 2 #define CONFIGURATION_HPP_ 13 bool mUseDefault =
false;
16 enum ConfigurationType {
32 ConfigurationType
getType(std::string
const &name)
const;
34 bool const &getBooleanArgument(std::string
const &name)
const;
35 int const &getIntegerArgument(std::string
const &name)
const;
36 unsigned int const &getUnsignedIntArgument(std::string
const &name)
const;
37 std::string
const &getStringArgument(std::string
const &name)
const;
38 IntOptional const &getIntOptionalArgument(std::string
const &name)
const;
40 static std::string printBooleanArgument(std::string
const &name,
bool const &value);
42 static std::string printIntegerArgument(std::string
const &name,
int const &value);
44 static std::string printUnsignedArgument(std::string
const &name,
unsigned int const &value);
46 static std::string printStringArgument(std::string
const &name, std::string
const &value);
48 static std::string printIntOptionalArgument(std::string
const &name,
IntOptional const &value);
50 std::string printArgument(std::string
const &name)
const;
52 std::string printConfig()
const;
54 bool setArgumentUsingString(std::string
const &name, std::string
const &value);
55 bool setBooleanArgument(std::string
const &name,
bool const &value);
56 bool setIntegerArgument(std::string
const &name,
int const &value);
57 bool setUnsignedIntArgument(std::string
const &name,
unsigned int const &value);
58 bool setStringArgument(std::string
const &name, std::string
const &value);
59 bool setIntOptionalArgument(std::string
const &name,
IntOptional const &value);
62 void registerArgument(std::string
const &name, ConfigurationType type);
63 void registerBooleanArgument(std::string
const &name);
64 void registerIntegerArgument(std::string
const &name);
65 void registerUnsignedIntArgument(std::string
const &name);
66 void registerStringArgument(std::string
const &name);
67 void registerIntOptionalArgument(std::string
const &name);
69 bool parseBoolean(std::string
const &valueString)
const;
70 int parseInteger(std::string
const &valueString)
const;
71 unsigned int parseUnsignedInt(std::string
const &valueString)
const;
72 std::string parseString(std::string
const &valueString)
const;
73 IntOptional parseIntOptional(std::string
const &valueString)
const;
77 std::vector<std::string> mConfigArguments;
78 std::map<std::string, ConfigurationType> mConfigTypeMap;
79 std::map<std::string, bool> mBooleanConfigMap;
80 std::map<std::string, int> mIntegerConfigMap;
81 std::map<std::string, unsigned int> mUnsignedIntConfigMap;
82 std::map<std::string, std::string> mStringConfigMap;
83 std::map<std::string, IntOptional> mIntOptionalConfigMap;
88 #endif // CONFIGURATION_HPP_ ConfigurationType getType(std::string const &name) const