8 #ifndef AJA_COMMANDLINE_H
9 #define AJA_COMMANDLINE_H
36 const std::string &desc);
38 const std::string &desc,
39 const std::string &defaultValue);
42 const std::string &desc);
44 const std::string &desc,
45 const std::string &defaultValue);
53 bool AddName(
const std::string &name);
67 std::string GetDesc()
const;
74 void SetDesc(
const std::string &desc);
81 std::string GetExtraDesc()
const;
88 void SetExtraDesc(
const std::string &desc);
95 void SetDefaultValue(
const std::string &value);
102 std::string GetDefaultValue()
const;
104 void AddValue(
const std::string &value);
105 std::string GetValue(
size_t index = 0)
const;
111 std::string mDescExtra;
113 std::string mDefaultValue;
122 typedef std::map<std::string, AJACommandLineParser *>
SubParserMap;
148 void Reset(
bool clearAll=
false);
174 void ParseArgs(
int argc,
const char *argv[]);
181 void ParseArgs(
int argc,
char *argv[]);
189 bool IsSet(
const std::string &name)
const;
198 AJAVariant Value(
const std::string &name,
size_t index = 0)
const;
215 std::string ValueString(
const std::string &name,
size_t index = 0)
const;
243 bool AddOptions(
const std::vector<AJACommandLineOption> &options);
248 bool AddHelpOption();
254 std::string GetName()
const;
260 void SetUsageText(
const std::string &usageText);
266 std::string GetUsageText()
const;
272 void SetHelpText(
const std::string &helpText);
278 std::string GetHelpText()
const;
284 std::string GetCommandName();
299 static bool hasOptionPrefix(
const std::string &name);
301 bool parseValue(
const std::string &arg, std::string &value);
302 bool parseOptionValue(
const std::string &name,
const std::string &arg, AJAStringList::const_iterator *iter, AJAStringList::const_iterator
end);
303 bool setOptionValue(
const std::string &name,
const std::string &value);
304 std::string removePrefix(
const std::string &name,
int &count);
308 std::string mCommandName;
310 std::string mDescExtra;
311 std::string mUsageText;
312 std::string mHelpText;
321 #endif // AJA_COMMANDLINE_H