Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Protected Member Functions | Protected Attributes
TCLAP::UnlabeledMultiArg Class Reference

Detailed Description

Just like a MultiArg, except that the arguments are unlabeled.

Basically, this Arg will slurp up everything that hasn't been matched to another Arg.

#include <mrpt/otherlibs/tclap/UnlabeledMultiArg.h>

Inheritance diagram for TCLAP::UnlabeledMultiArg:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, bool ignoreable=false, Visitor *v=NULL)
 Constructor.
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, CmdLineInterface &parser, bool ignoreable=false, Visitor *v=NULL)
 Constructor.
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, Constraint< T > *constraint, bool ignoreable=false, Visitor *v=NULL)
 Constructor.
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, Constraint< T > *constraint, CmdLineInterface &parser, bool ignoreable=false, Visitor *v=NULL)
 Constructor.
virtual bool processArg (int *i, std::vector< std::string > &args)
 Handles the processing of the argument.
virtual std::string shortID (const std::string &val="val") const
 Returns the a short id string.
virtual std::string longID (const std::string &val="val") const
 Returns the a long id string.
virtual bool operator== (const Arg &a) const
 Opertor ==.
virtual void addToList (std::list< Arg * > &argList) const
 Pushes this to back of list rather than front.
const std::vector< T > & getValue ()
 Returns a vector of type T containing the values parsed from the command line.
virtual bool isRequired () const
 Once we've matched the first value, then the arg is no longer required.
virtual bool allowMore ()

Protected Member Functions

void _extractValue (const std::string &val)
 Extracts the value from the string.

Protected Attributes

std::vector< T > _values
 The list of values parsed from the CmdLine.
std::string _typeDesc
 The description of type T to be used in the usage.
Constraint< T > * _constraint
 A list of constraint on this Arg.
bool _allowMore

Constructor & Destructor Documentation

TCLAP::UnlabeledMultiArg::UnlabeledMultiArg ( const std::string name,
const std::string desc,
bool  req,
const std::string typeDesc,
bool  ignoreable = false,
Visitor v = NULL 
)

Constructor.

Parameters:
name- The name of the Arg. Note that this is used for identification, not as a long flag.
desc- A description of what the argument is for or does.
req- Whether the argument is required on the command line.
typeDesc- A short, human readable description of the type that this object expects. This is used in the generation of the USAGE statement. The goal is to be helpful to the end user of the program.
ignoreable- Whether or not this argument can be ignored using the "--" flag.
v- An optional visitor. You probably should not use this unless you have a very good reason.

Definition at line 187 of file UnlabeledMultiArg.h.

References TCLAP::OptionalUnlabeledTracker::check().

TCLAP::UnlabeledMultiArg::UnlabeledMultiArg ( const std::string name,
const std::string desc,
bool  req,
const std::string typeDesc,
CmdLineInterface parser,
bool  ignoreable = false,
Visitor v = NULL 
)

Constructor.

Parameters:
name- The name of the Arg. Note that this is used for identification, not as a long flag.
desc- A description of what the argument is for or does.
req- Whether the argument is required on the command line.
typeDesc- A short, human readable description of the type that this object expects. This is used in the generation of the USAGE statement. The goal is to be helpful to the end user of the program.
parser- A CmdLine parser object to add this Arg to
ignoreable- Whether or not this argument can be ignored using the "--" flag.
v- An optional visitor. You probably should not use this unless you have a very good reason.

Definition at line 200 of file UnlabeledMultiArg.h.

References TCLAP::OptionalUnlabeledTracker::check(), and TCLAP::CmdLineInterface::add().

TCLAP::UnlabeledMultiArg::UnlabeledMultiArg ( const std::string name,
const std::string desc,
bool  req,
Constraint< T > *  constraint,
bool  ignoreable = false,
Visitor v = NULL 
)

Constructor.

Parameters:
name- The name of the Arg. Note that this is used for identification, not as a long flag.
desc- A description of what the argument is for or does.
req- Whether the argument is required on the command line.
constraint- A pointer to a Constraint object used to constrain this Arg.
ignoreable- Whether or not this argument can be ignored using the "--" flag.
v- An optional visitor. You probably should not use this unless you have a very good reason.

Definition at line 216 of file UnlabeledMultiArg.h.

References TCLAP::OptionalUnlabeledTracker::check().

TCLAP::UnlabeledMultiArg::UnlabeledMultiArg ( const std::string name,
const std::string desc,
bool  req,
Constraint< T > *  constraint,
CmdLineInterface parser,
bool  ignoreable = false,
Visitor v = NULL 
)

Constructor.

Parameters:
name- The name of the Arg. Note that this is used for identification, not as a long flag.
desc- A description of what the argument is for or does.
req- Whether the argument is required on the command line.
constraint- A pointer to a Constraint object used to constrain this Arg.
parser- A CmdLine parser object to add this Arg to
ignoreable- Whether or not this argument can be ignored using the "--" flag.
v- An optional visitor. You probably should not use this unless you have a very good reason.

Definition at line 229 of file UnlabeledMultiArg.h.

References TCLAP::OptionalUnlabeledTracker::check(), and TCLAP::CmdLineInterface::add().


Member Function Documentation

void TCLAP::MultiArg::_extractValue ( const std::string val) [protected, inherited]

Extracts the value from the string.

Attempts to parse string as type T, if this fails an exception is thrown.

Parameters:
val- The string to be read.
void TCLAP::UnlabeledMultiArg::addToList ( std::list< Arg * > &  argList) const [virtual]

Pushes this to back of list rather than front.

Parameters:
argList- The list this should be added to.

Definition at line 296 of file UnlabeledMultiArg.h.

virtual bool TCLAP::MultiArg::allowMore ( ) [virtual, inherited]
const std::vector<T>& TCLAP::MultiArg::getValue ( ) [inherited]

Returns a vector of type T containing the values parsed from the command line.

virtual bool TCLAP::MultiArg::isRequired ( ) const [virtual, inherited]

Once we've matched the first value, then the arg is no longer required.

std::string TCLAP::UnlabeledMultiArg::longID ( const std::string val = "val") const [virtual]

Returns the a long id string.

Used in the usage.

Parameters:
val- value to be used.

Reimplemented from TCLAP::MultiArg< T >.

Definition at line 279 of file UnlabeledMultiArg.h.

bool TCLAP::UnlabeledMultiArg::operator== ( const Arg a) const [virtual]

Opertor ==.

Parameters:
a- The Arg to be compared to this.

Definition at line 287 of file UnlabeledMultiArg.h.

References TCLAP::Arg::getName(), and TCLAP::Arg::getDescription().

bool TCLAP::UnlabeledMultiArg::processArg ( int *  i,
std::vector< std::string > &  args 
) [virtual]

Handles the processing of the argument.

This re-implements the Arg version of this method to set the _value of the argument appropriately. It knows the difference between labeled and unlabeled.

Parameters:
i- Pointer the the current argument in the list.
args- Mutable list of strings. Passed from main().

Reimplemented from TCLAP::MultiArg< T >.

Definition at line 245 of file UnlabeledMultiArg.h.

std::string TCLAP::UnlabeledMultiArg::shortID ( const std::string val = "val") const [virtual]

Returns the a short id string.

Used in the usage.

Parameters:
val- value to be used.

Reimplemented from TCLAP::MultiArg< T >.

Definition at line 271 of file UnlabeledMultiArg.h.


Member Data Documentation

bool TCLAP::MultiArg::_allowMore [protected, inherited]

Definition at line 194 of file MultiArg.h.

Constraint<T>* TCLAP::MultiArg::_constraint [protected, inherited]

A list of constraint on this Arg.

Definition at line 184 of file MultiArg.h.

std::string TCLAP::MultiArg::_typeDesc [protected, inherited]

The description of type T to be used in the usage.

Definition at line 179 of file MultiArg.h.

std::vector<T> TCLAP::MultiArg::_values [protected, inherited]

The list of values parsed from the CmdLine.

Definition at line 174 of file MultiArg.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011