C++ Utilities
4.14.2
Useful C++ classes and routines such as argument parser, IO and conversion utilities
|
The ArgumentOccurrence struct holds argument values for an occurrence of an argument. More...
#include <argumentparser.h>
Public Member Functions | |
ArgumentOccurrence (std::size_t index) | |
Constructs an argument occurrence for the specified index. More... | |
ArgumentOccurrence (std::size_t index, const std::vector< Argument *> parentPath, Argument *parent) | |
Constructs an argument occurrence. More... | |
template<typename TargetType > | |
std::tuple< TargetType > | convertValues () const |
Converts the present value to the specified target type. More... | |
template<typename FirstTargetType , typename... RemainingTargetTypes> | |
std::tuple< FirstTargetType, RemainingTargetTypes... > | convertValues () const |
Converts the present values to the specified target types. More... | |
Public Attributes | |
std::size_t | index |
The index of the occurrence. More... | |
std::vector< const char * > | values |
The parameter values which have been specified after the occurrence of the argument. More... | |
std::vector< Argument * > | path |
The "path" of the occurrence (the parent elements which have been specified before). More... | |
The ArgumentOccurrence struct holds argument values for an occurrence of an argument.
Definition at line 152 of file argumentparser.h.
|
inline |
Constructs an argument occurrence for the specified index.
Definition at line 212 of file argumentparser.h.
|
inline |
Constructs an argument occurrence.
index | Specifies the index. |
parentPath | Specifies the path of parent. |
parent | Specifies the parent which might be nullptr for top-level occurrences. |
The path of the new occurrence is built from the specified parentPath and parent.
Definition at line 225 of file argumentparser.h.
std::tuple< TargetType > ApplicationUtilities::ArgumentOccurrence::convertValues | ( | ) | const |
Converts the present value to the specified target type.
There must be at least one value present.
Definition at line 184 of file argumentparser.h.
std::tuple< FirstTargetType, RemainingTargetTypes... > ApplicationUtilities::ArgumentOccurrence::convertValues | ( | ) | const |
Converts the present values to the specified target types.
There must be as many values present as types are specified.
Definition at line 194 of file argumentparser.h.
std::size_t ApplicationUtilities::ArgumentOccurrence::index |
The index of the occurrence.
This is not necessarily the index in the argv array.
Definition at line 159 of file argumentparser.h.
std::vector<Argument *> ApplicationUtilities::ArgumentOccurrence::path |
The "path" of the occurrence (the parent elements which have been specified before).
Definition at line 170 of file argumentparser.h.
std::vector<const char *> ApplicationUtilities::ArgumentOccurrence::values |
The parameter values which have been specified after the occurrence of the argument.
Definition at line 164 of file argumentparser.h.