Go to the documentation of this file.
24 #ifndef TCLAP_CMDLINE_H
25 #define TCLAP_CMDLINE_H
53 template<
typename T>
void DelPtr(T ptr)
60 typedef typename C::value_type value_type;
61 std::for_each(
c.begin(),
c.end(), DelPtr<value_type>);
70 class CmdLine :
public CmdLineInterface
201 const char delimiter =
' ',
203 bool helpAndVersion =
true);
235 void xorAdd( std::vector<Arg*>& xors );
242 void parse(
int argc,
const char *
const * argv);
249 void parse(std::vector<std::string>&
args);
328 _argList(
std::list<
Arg*>()),
329 _progName(
"not_set_yet"),
335 _argDeleteOnExitList(
std::list<
Arg*>()),
336 _visitorDeleteOnExitList(
std::list<
Visitor*>()),
338 _handleExceptions(true),
339 _userSetOutput(false),
340 _helpAndVersion(
help)
368 "Displays usage information and exits.",
376 "Displays version information and exits.",
386 "Ignores the rest of the labeled arguments following this flag.",
399 (*it)->forceRequired();
400 (*it)->setRequireLabel(
"OR required" );
407 std::vector<Arg*> ors;
423 "Argument with same flag/name already exists!",
428 if (
a->isRequired() )
438 for (
int i = 0;
i < argc;
i++)
439 args.push_back(argv[
i]);
446 bool shouldExit =
false;
453 int requiredCount = 0;
455 for (
int i = 0;
static_cast<unsigned int>(
i) <
args.size();
i++)
457 bool matched =
false;
460 if ( (*it)->processArg( &
i,
args ) )
474 throw(CmdLineParseException(
"Couldn't find match "
483 throw(CmdLineParseException(
"Too many arguments!"));
485 }
catch ( ArgException&
e ) {
493 }
catch ( ExitException &ee ) {
494 estat = ee.getExitStatus();
497 }
catch (ExitException &ee) {
503 estat = ee.getExitStatus();
516 for (
int i = 1;
static_cast<unsigned int>(
i) <
s.length();
i++ )
530 if ( (*it)->isRequired() && !(*it)->isSet() )
532 missingArgList += (*it)->getName();
533 missingArgList +=
", ";
537 missingArgList = missingArgList.substr(0,missingArgList.length()-2);
541 msg =
"Required arguments missing: ";
543 msg =
"Required argument missing: ";
545 msg += missingArgList;
bool _emptyCombined(const std::string &s)
bool getExceptionHandling() const
std::list< Arg * > _argDeleteOnExitList
CmdLineOutput * getOutput()
GLboolean GLboolean GLboolean b
void parse(int argc, const char *const *argv)
std::list< Arg * >::iterator ArgListIterator
GLsizei const GLchar *const * string
static const std::string flagStartString()
void setExceptionHandling(const bool state)
std::string & getMessage()
void ClearContainer(C &c)
void missingArgsException()
std::string & getVersion()
void setOutput(CmdLineOutput *co)
CmdLine(const CmdLine &rhs)
std::list< Arg * > & getArgList()
static void setDelimiter(char c)
CmdLine & operator=(const CmdLine &rhs)
XorHandler & getXorHandler()
std::vector< Arg * >::iterator ArgVectorIterator
GLenum GLuint GLenum GLsizei const GLchar * message
GLboolean GLboolean GLboolean GLboolean a
std::list< Arg * > _argList
virtual void failure(CmdLineInterface &c, ArgException &e)=0
std::list< Visitor * > _visitorDeleteOnExitList
void xorAdd(Arg &a, Arg &b)
void add(std::vector< Arg * > &ors)
static char flagStartChar()
void deleteOnExit(Arg *ptr)
static const textual_icon exit
std::string & getProgramName()
static const std::string ignoreNameString()
librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01