args-parser 6.3.3
Loading...
Searching...
No Matches
Args::AtLeastOneGroup Class Referencefinal

Group of args where at least one argument should be defined. More...

#include <groups.hpp>

+ Inheritance diagram for Args::AtLeastOneGroup:
+ Collaboration diagram for Args::AtLeastOneGroup:

Public Member Functions

template<typename T >
 AtLeastOneGroup (T &&name, bool required=false)
 
virtual ~AtLeastOneGroup ()
 
ArgType type () const override
 
bool isDefined () const override
 
- Public Member Functions inherited from Args::GroupIface
template<typename T >
 GroupIface (T &&name, bool required=false)
 
virtual ~GroupIface ()
 
const Argumentschildren () const
 
void addArg (ArgIface &arg)
 Add argument.
 
void addArg (ArgIface *arg)
 Add argument.
 
virtual void addArg (ArgPtr arg)
 Add argument.
 
String name () const override
 
bool isWithValue () const override
 
bool isRequired () const override
 
virtual void setRequired (bool on=true)
 Set required flag.
 
const Stringflag () const override
 
const StringargumentName () const override
 
const StringvalueSpecifier () const override
 
const Stringdescription () const override
 
const StringlongDescription () const override
 
void clear () override
 Clear state of the argument.
 
- Public Member Functions inherited from Args::ArgIface
 ArgIface ()
 
virtual ~ArgIface ()
 
CmdLinecmdLine () const
 

Protected Member Functions

void checkCorrectnessBeforeParsing (StringList &flags, StringList &names) const override
 Check correctness of the argument before parsing.
 
- Protected Member Functions inherited from Args::GroupIface
ArgIfacefindArgument (const String &name) override
 
void process (Context &) override
 Process argument's staff, for example take values from context.
 
void checkCorrectnessBeforeParsing (StringList &flags, StringList &names) const override
 Check correctness of the argument before parsing.
 
void checkCorrectnessAfterParsing () const override
 Check correctness of the argument after parsing.
 
void setCmdLine (CmdLine *cmdLine) override
 Set command line parser.
 
bool isMisspelledName (const String &name, StringList &possibleNames) const override
 

Additional Inherited Members

- Public Types inherited from Args::GroupIface
using ArgPtr = std::unique_ptr< ArgIface, details::Deleter< ArgIface > >
 Smart pointer to the argument.
 
using Arguments = std::vector< ArgPtr >
 List of child arguments.
 
- Protected Attributes inherited from Args::GroupIface
Arguments m_children
 List of children.
 

Detailed Description

Group of args where at least one argument should be defined.

Definition at line 213 of file groups.hpp.

Constructor & Destructor Documentation

◆ AtLeastOneGroup()

template<typename T >
Args::AtLeastOneGroup::AtLeastOneGroup ( T &&  name,
bool  required = false 
)
inlineexplicit

Definition at line 218 of file groups.hpp.

◆ ~AtLeastOneGroup()

virtual Args::AtLeastOneGroup::~AtLeastOneGroup ( )
inlinevirtual

Definition at line 224 of file groups.hpp.

Member Function Documentation

◆ checkCorrectnessBeforeParsing()

void Args::AtLeastOneGroup::checkCorrectnessBeforeParsing ( StringList flags,
StringList names 
) const
inlineoverrideprotectedvirtual

Check correctness of the argument before parsing.

Implementation of this method must add his flag and name to the flags and names.

Parameters
flagsAll known flags.
namesAll known names.

Implements Args::ArgIface.

Definition at line 248 of file groups.hpp.

◆ isDefined()

bool Args::AtLeastOneGroup::isDefined ( ) const
inlineoverridevirtual
Returns
Is this argument defined?

Implements Args::ArgIface.

Definition at line 235 of file groups.hpp.

◆ type()

ArgType Args::AtLeastOneGroup::type ( ) const
inlineoverridevirtual
Returns
Type of the argument.

Implements Args::ArgIface.

Definition at line 229 of file groups.hpp.


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