args-parser 6.3.3
|
Interface for the groups. More...
#include <group_iface.hpp>
Public Types | |
using | ArgPtr = std::unique_ptr< ArgIface, details::Deleter< ArgIface > > |
Smart pointer to the argument. | |
using | Arguments = std::vector< ArgPtr > |
List of child arguments. | |
Public Member Functions | |
template<typename T > | |
GroupIface (T &&name, bool required=false) | |
virtual | ~GroupIface () |
const Arguments & | children () 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 String & | flag () const override |
const String & | argumentName () const override |
const String & | valueSpecifier () const override |
const String & | description () const override |
const String & | longDescription () const override |
void | clear () override |
Clear state of the argument. | |
Public Member Functions inherited from Args::ArgIface | |
ArgIface () | |
virtual | ~ArgIface () |
virtual ArgType | type () const =0 |
virtual bool | isDefined () const =0 |
CmdLine * | cmdLine () const |
Protected Member Functions | |
ArgIface * | findArgument (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 |
Protected Attributes | |
Arguments | m_children |
List of children. | |
Interface for the groups.
Definition at line 59 of file group_iface.hpp.
using Args::GroupIface::ArgPtr = std::unique_ptr< ArgIface, details::Deleter< ArgIface > > |
Smart pointer to the argument.
Definition at line 64 of file group_iface.hpp.
using Args::GroupIface::Arguments = std::vector< ArgPtr > |
List of child arguments.
Definition at line 66 of file group_iface.hpp.
|
inlineexplicit |
Definition at line 69 of file group_iface.hpp.
|
inlinevirtual |
Definition at line 76 of file group_iface.hpp.
|
inline |
Add argument.
Definition at line 87 of file group_iface.hpp.
|
inline |
Add argument.
Definition at line 93 of file group_iface.hpp.
|
inlinevirtual |
Add argument.
Reimplemented in Args::Command, and Args::Command.
Definition at line 99 of file group_iface.hpp.
|
inlineoverridevirtual |
|
inlineoverrideprotectedvirtual |
Check correctness of the argument after parsing.
Implements Args::ArgIface.
Reimplemented in Args::OnlyOneGroup.
Definition at line 234 of file group_iface.hpp.
|
inlineoverrideprotectedvirtual |
Check correctness of the argument before parsing.
Implementation of this method must add his flag and name to the flags and names.
flags | All known flags. |
names | All known names. |
Implements Args::ArgIface.
Reimplemented in Args::OnlyOneGroup.
Definition at line 223 of file group_iface.hpp.
|
inline |
Definition at line 81 of file group_iface.hpp.
|
inlineoverridevirtual |
Clear state of the argument.
Implements Args::ArgIface.
Definition at line 171 of file group_iface.hpp.
|
inlineoverridevirtual |
Implements Args::ArgIface.
Definition at line 159 of file group_iface.hpp.
Pointer | to the ArgIface if this argument handles argument with the given name. |
nullptr | if this argument doesn't know about argument with name. |
name | Name of the argument. Can be for example "-t" or "--timeout". |
Implements Args::ArgIface.
Definition at line 188 of file group_iface.hpp.
|
inlineoverridevirtual |
|
inlineoverrideprotectedvirtual |
name | Name to check (misspelled). |
possibleNames | List of possible names for the given misspelled name. |
Implements Args::ArgIface.
Definition at line 255 of file group_iface.hpp.
|
inlineoverridevirtual |
Implements Args::ArgIface.
Definition at line 129 of file group_iface.hpp.
|
inlineoverridevirtual |
Implements Args::ArgIface.
Definition at line 123 of file group_iface.hpp.
|
inlineoverridevirtual |
Implements Args::ArgIface.
Definition at line 165 of file group_iface.hpp.
|
inlineoverridevirtual |
If name is empty returned value should be a flag. I.e. for example "-t" or "--timeout"
Implements Args::ArgIface.
Definition at line 117 of file group_iface.hpp.
|
inlineoverrideprotectedvirtual |
Process argument's staff, for example take values from context.
This method invokes exactly at that moment when parser has found this argument.
Implements Args::ArgIface.
Definition at line 211 of file group_iface.hpp.
|
inlineoverrideprotectedvirtual |
Set command line parser.
Reimplemented from Args::ArgIface.
Definition at line 246 of file group_iface.hpp.
|
inlinevirtual |
|
inlineoverridevirtual |
|
protected |
List of children.
Definition at line 275 of file group_iface.hpp.