Simple set of arguments. More...
#include <ArgumentConstraint.hpp>
Public Member Functions | |
| template<typename... A> | |
| ArgumentSet (const std::string &name, A &&...args) | |
| Create a new named ArgumentSet. More... | |
| ArgumentSet (const ArgumentSet &)=default | |
| ArgumentSet copy constructor. | |
| ArgumentSet (ArgumentSet &&)=default | |
| ArgumentSet move constructor. | |
| virtual | ~ArgumentSet () |
| ArgumentSet destructor. | |
| ArgumentSet & | operator= (const ArgumentSet &)=default |
| ArgumentSet assignment. | |
| ArgumentSet & | operator= (ArgumentSet &&)=default |
| ArgumentSet move assignment. | |
| const std::string & | name () const |
| Get the name of this ArgumentSet. More... | |
| const std::vector< const Argument * > & | args () const |
| Get the Arguments contained in this ArgumentSet. More... | |
| template<typename Arg > | |
| ArgumentSet & | add (Arg &&arg) |
| Add an argument to the set. More... | |
| std::unique_ptr< BaseArgument > | clone () const &override |
| See BaseArgument::clone(). | |
| std::unique_ptr< BaseArgument > | clone ()&&override |
| See BaseArgument::clone(). | |
Public Member Functions inherited from TAP::ArgumentConstraint< ConstraintType::Any > | |
| ArgumentConstraint (A &&...args) | |
| Construct a ArgumentConstraint with the (possibly empty) given list of arguments. More... | |
| ArgumentConstraint (const ArgumentConstraint &other) | |
| ArgumentConstraint copy constructor. | |
| ArgumentConstraint (ArgumentConstraint &&)=default | |
| ArgumentConstraint move constructor. | |
| virtual | ~ArgumentConstraint () |
| ArgumentConstraint destructor. | |
| ArgumentConstraint & | operator= (ArgumentConstraint other) |
| ArgumentConstraint assignment operator. | |
| ArgumentConstraint & | operator= (ArgumentConstraint &&)=default |
| ArgumentConstraint move assignment operator. | |
| ArgumentConstraint & | operator+= (Argument &arg) |
| Appends the given argument to the constraint. More... | |
| size_t | size () const |
| Returns the number of contained sub-arguments. More... | |
| void | find_all_arguments (std::vector< const Argument * > &collector) const override |
| See BaseArgument::find_all_arguments() | |
| void | check_valid () const override |
| See BaseArgument::set() | |
| std::string | usage () const override |
| See BaseArgument::usage() | |
| std::unique_ptr< BaseArgument > | clone () const &override |
| See BaseArgument::clone(). | |
| std::unique_ptr< BaseArgument > | clone ()&&override |
| See BaseArgument::clone(). | |
Public Member Functions inherited from TAP::BaseArgument | |
| BaseArgument () | |
| Base constructor. | |
| BaseArgument (const BaseArgument &)=default | |
| BaseArgument copy constructor. | |
| BaseArgument (BaseArgument &&)=default | |
| BaseArgument move constructor. | |
| virtual | ~BaseArgument () |
| BaseArgument destructor. | |
| BaseArgument & | operator= (const BaseArgument &)=default |
| BaseArgument assignment operator. | |
| BaseArgument & | operator= (BaseArgument &&)=default |
| BaseArgument move assignment operator. | |
| operator bool () const | |
| Boolean conversion operator (so you can do things like if (arg) { ... More... | |
| BaseArgument & | set_required (bool required=true) |
| Mark the argument as required or not. More... | |
| bool | required () const |
| Returns whether the argument is required. More... | |
Protected Attributes | |
| std::string | m_name |
| The name of this ArgumentSet. | |
| std::vector< const Argument * > | m_args |
| Cached arguments. | |
| bool | m_updateArgs = true |
| If true updates list of known arguments when retrieving them. | |
Protected Attributes inherited from TAP::ArgumentConstraint< ConstraintType::Any > | |
|
std::vector< std::unique_ptr < BaseArgument > > | m_args |
| Sub-arguments to check. | |
| std::string | m_usageString |
| Stored usage string. | |
Protected Attributes inherited from TAP::BaseArgument | |
| bool | m_required = false |
| True if the argument has to be set. | |
Additional Inherited Members | |
Protected Member Functions inherited from TAP::ArgumentConstraint< ConstraintType::Any > | |
| ArgumentConstraint & | add (Arg &&arg) |
| Add an argument to the constraint. More... | |
| unsigned int | count () const override |
| Returns the number of child arguments which are set. | |
| void | diagnose_args () const |
| Calls diagnose for all set child arguments. | |
| std::string | usageArgument (const Argument &arg) const |
| Returns a string for usage representation of sub-arguments. More... | |
| std::string | usageArgument (const ArgumentConstraint< ACType > &arg) const |
| Returns a string for usage representation of sub-arguments. More... | |
Simple set of arguments.
Acts very much like ArgumentConstraint<All>, but does not modify arguments on insertion. Designed to be used by the parser.
| TAP::ArgumentSet::ArgumentSet | ( | const std::string & | name, |
| A &&... | args | ||
| ) |
Create a new named ArgumentSet.
The parameter args defines the initial set of arguments.
| name | (Descriptive) name of the argument set |
| args | Arguments to add to the set initially |
|
inline |
|
inline |
Get the Arguments contained in this ArgumentSet.
Duplicates are filtered out.
|
inline |
Get the name of this ArgumentSet.
1.8.6