C++ Utilities 5.27.0
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. | |
ArgumentOccurrence (std::size_t index, const std::vector< Argument * > parentPath, Argument *parent) | |
Constructs an argument occurrence. | |
template<typename... RemainingTargetTypes> | |
std::tuple< RemainingTargetTypes... > | convertValues () const |
Converts the present values to the specified target types. | |
Public Attributes | |
std::size_t | index |
The index of the occurrence. | |
std::vector< const char * > | values |
The parameter values which have been specified after the occurrence of the argument. | |
std::vector< Argument * > | path |
The "path" of the occurrence (the parent elements which have been specified before). | |
The ArgumentOccurrence struct holds argument values for an occurrence of an argument.
Definition at line 194 of file argumentparser.h.
|
inline |
Constructs an argument occurrence for the specified index.
Definition at line 241 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 254 of file argumentparser.h.
std::tuple< RemainingTargetTypes... > CppUtilities::ArgumentOccurrence::convertValues | ( | ) | const |
Converts the present values to the specified target types.
There must be as many values present as types are specified.
Throws | ArgumentUtilities::Failure when the number of present values is not sufficient or a conversion error occurs. |
Definition at line 225 of file argumentparser.h.
std::size_t CppUtilities::ArgumentOccurrence::index |
The index of the occurrence.
This is not necessarily the index in the argv array.
Definition at line 201 of file argumentparser.h.
std::vector<Argument *> CppUtilities::ArgumentOccurrence::path |
The "path" of the occurrence (the parent elements which have been specified before).
Definition at line 212 of file argumentparser.h.
std::vector<const char *> CppUtilities::ArgumentOccurrence::values |
The parameter values which have been specified after the occurrence of the argument.
Definition at line 206 of file argumentparser.h.