Public Member Functions | List of all members
ecl::UnlabeledMultiArg< T > Class Template Reference

#include <unlabeled_multi_arg.hpp>

Inheritance diagram for ecl::UnlabeledMultiArg< T >:
Inheritance graph
[legend]

Public Member Functions

virtual void addToList (std::list< Arg * > &argList) const
 
virtual std::string longID (const std::string &val="val") const
 
virtual bool operator== (const Arg &a) const
 
virtual bool processArg (int *i, std::vector< std::string > &args)
 
virtual std::string shortID (const std::string &val="val") const
 
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, bool ignoreable=false, Visitor *v=NULL)
 
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, CmdLineInterface &parser, bool ignoreable=false, Visitor *v=NULL)
 
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, Constraint< T > *constraint, bool ignoreable=false, Visitor *v=NULL)
 
 UnlabeledMultiArg (const std::string &name, const std::string &desc, bool req, Constraint< T > *constraint, CmdLineInterface &parser, bool ignoreable=false, Visitor *v=NULL)
 
- Public Member Functions inherited from ecl::MultiArg< T >
virtual bool allowMore ()
 
const std::vector< T > & getValue ()
 
virtual bool isRequired () const
 
 MultiArg (const std::string &flag, const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, CmdLineInterface &parser, Visitor *v=NULL)
 
 MultiArg (const std::string &flag, const std::string &name, const std::string &desc, bool req, const std::string &typeDesc, Visitor *v=NULL)
 
 MultiArg (const std::string &flag, const std::string &name, const std::string &desc, bool req, Constraint< T > *constraint, CmdLineInterface &parser, Visitor *v=NULL)
 
 MultiArg (const std::string &flag, const std::string &name, const std::string &desc, bool req, Constraint< T > *constraint, Visitor *v=NULL)
 

Additional Inherited Members

- Protected Member Functions inherited from ecl::MultiArg< T >
void _extractValue (const std::string &val)
 
- Protected Attributes inherited from ecl::MultiArg< T >
bool _allowMore
 
Constraint< T > * _constraint
 
std::string _typeDesc
 
std::vector< T > _values
 

Detailed Description

template<class T>
class ecl::UnlabeledMultiArg< T >

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.

Definition at line 34 of file unlabeled_multi_arg.hpp.

Constructor & Destructor Documentation

◆ UnlabeledMultiArg() [1/4]

template<class T >
ecl::UnlabeledMultiArg< T >::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 181 of file unlabeled_multi_arg.hpp.

◆ UnlabeledMultiArg() [2/4]

template<class T >
ecl::UnlabeledMultiArg< T >::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 194 of file unlabeled_multi_arg.hpp.

◆ UnlabeledMultiArg() [3/4]

template<class T >
ecl::UnlabeledMultiArg< T >::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 210 of file unlabeled_multi_arg.hpp.

◆ UnlabeledMultiArg() [4/4]

template<class T >
ecl::UnlabeledMultiArg< T >::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 223 of file unlabeled_multi_arg.hpp.

Member Function Documentation

◆ addToList()

template<class T >
void ecl::UnlabeledMultiArg< T >::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 290 of file unlabeled_multi_arg.hpp.

◆ longID()

template<class T >
std::string ecl::UnlabeledMultiArg< T >::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 ecl::MultiArg< T >.

Definition at line 273 of file unlabeled_multi_arg.hpp.

◆ operator==()

template<class T >
bool ecl::UnlabeledMultiArg< T >::operator== ( const Arg a) const
virtual

Opertor ==.

Parameters
a- The Arg to be compared to this.

Definition at line 281 of file unlabeled_multi_arg.hpp.

◆ processArg()

template<class T >
bool ecl::UnlabeledMultiArg< T >::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 ecl::MultiArg< T >.

Definition at line 239 of file unlabeled_multi_arg.hpp.

◆ shortID()

template<class T >
std::string ecl::UnlabeledMultiArg< T >::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 ecl::MultiArg< T >.

Definition at line 265 of file unlabeled_multi_arg.hpp.


The documentation for this class was generated from the following file:


ecl_command_line
Author(s): Daniel Stonier
autogenerated on Sun Aug 2 2020 03:12:03