22 #ifndef DtCmdLine_CMDLINE_H
23 #define DtCmdLine_CMDLINE_H
52 #ifdef DtUSE_UTILITIES_NAMESPACE
53 namespace DtUSE_UTILITIES_NAMESPACE
132 bool _emptyCombined(
const std::string& s);
147 void deleteOnExit(
Arg* ptr);
152 void deleteOnExit(
Visitor* ptr);
172 CmdLine(
const std::string& name,
173 const std::string& message,
174 const std::string& version =
"none",
176 bool pressAnyKey =
true);
178 bool pressAnyKey =
false);
191 CmdLine(
const std::string& message,
192 const char delimiter =
' ',
193 const std::string& version =
"none",
195 bool pressAnyKey =
true);
197 bool pressAnyKey =
false);
223 void xorAdd(
Arg& a,
Arg& b );
230 void xorAdd( std::vector<Arg*>& xors );
237 void parse(
int argc,
char** argv);
252 std::string& getVersion();
257 std::string& getProgramName();
262 std::list<Arg*>& getArgList();
277 std::string& getMessage();
285 inline CmdLine::CmdLine(
const std::string& n,
286 const std::string& m,
287 const std::string& v,
294 myPressAnyKey(pressAnyKey),
295 _userSetOutput(false)
302 const std::string& v,
304 : _progName(
"not_set_yet"),
309 myPressAnyKey(pressAnyKey),
310 _userSetOutput(false)
344 "Displays usage information and exits.",
352 "Displays version information and exits.",
361 "Ignores the rest of the labeled arguments following this flag.",
374 (*it)->forceRequired();
375 (*it)->setRequireLabel(
"OR required" );
383 std::vector<Arg*> ors;
414 std::vector<std::string> args;
416 for (i = 1; i < argc; i++)
417 args.push_back(argv[i]);
419 int requiredCount = 0;
421 for (i = 0; (
unsigned int)i < args.size(); i++)
423 bool matched =
false;
426 if ( (*it)->processArg( &i, args ) )
458 DtInfo <<
"Press any key to continue" << std::endl;
477 for (
int i = 1; (
unsigned int)i < s.length(); i++ )
543 #ifdef DtUSE_UTILITIES_NAMESPACE