C++ Utilities
4.9.2
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
|
#include <argumentparserprivate.h>
Public Member Functions | |
ArgumentReader (ArgumentParser &parser, const char *const *argv, const char *const *end, bool completionMode=false) | |
The ArgReader struct internally encapsulates the process of reading command line arguments. More... | |
ApplicationUtilities::ArgumentReader & | reset (const char *const *argv, const char *const *end) |
Resets the ArgumentReader to continue reading new argv. More... | |
void | read () |
Reads the commands line arguments specified when constructing the object. More... | |
void | read (ArgumentVector &args) |
Reads the commands line arguments specified when constructing the object. More... | |
Public Attributes | |
ArgumentParser & | parser |
The associated ArgumentParser instance. More... | |
ArgumentVector & | args |
The Argument instances to store the results. Sub arguments of args are considered as well. More... | |
size_t | index |
An index which is incremented when an argument is encountered (the current index is stored in the occurrence) or a value is encountered. More... | |
const char *const * | argv |
Points to the first argument denotation and will be incremented when a denotation has been processed. More... | |
const char *const * | end |
Points to the end of the argv array. More... | |
Argument * | lastArg |
The last Argument instance which could be detected. Set to nullptr in the initial call. Used for Bash completion. More... | |
const char *const * | lastArgDenotation |
Points to the element in argv where lastArg was encountered. Unspecified if lastArg is not set. More... | |
const char * | argDenotation |
The currently processed abbreviation denotation (should be substring of one of the args in argv). Set to nullptr for processing argv from the beginning (default). More... | |
unsigned char | argDenotationType |
The type of the currently processed abbreviation denotation. Unspecified if argDenotation is not set. More... | |
bool | completionMode |
Whether completion mode is enabled. In this case reading args will be continued even if an denotation is unknown (regardless of unknownArgumentBehavior()). More... | |
Definition at line 6 of file argumentparserprivate.h.
ApplicationUtilities::ArgumentReader::ArgumentReader | ( | ArgumentParser & | parser, |
const char *const * | argv, | ||
const char *const * | end, | ||
bool | completionMode = false |
||
) |
The ArgReader struct internally encapsulates the process of reading command line arguments.
Definition at line 44 of file argumentparser.cpp.
void ApplicationUtilities::ArgumentReader::read | ( | ) |
Reads the commands line arguments specified when constructing the object.
Definition at line 73 of file argumentparser.cpp.
void ApplicationUtilities::ArgumentReader::read | ( | ArgumentVector & | args | ) |
Reads the commands line arguments specified when constructing the object.
Definition at line 82 of file argumentparser.cpp.
ArgumentReader & ApplicationUtilities::ArgumentReader::reset | ( | const char *const * | argv, |
const char *const * | end | ||
) |
Resets the ArgumentReader to continue reading new argv.
Definition at line 59 of file argumentparser.cpp.
const char* ApplicationUtilities::ArgumentReader::argDenotation |
The currently processed abbreviation denotation (should be substring of one of the args in argv). Set to nullptr for processing argv from the beginning (default).
Definition at line 28 of file argumentparserprivate.h.
unsigned char ApplicationUtilities::ArgumentReader::argDenotationType |
The type of the currently processed abbreviation denotation. Unspecified if argDenotation is not set.
Definition at line 30 of file argumentparserprivate.h.
ArgumentVector& ApplicationUtilities::ArgumentReader::args |
The Argument instances to store the results. Sub arguments of args are considered as well.
Definition at line 16 of file argumentparserprivate.h.
const char* const* ApplicationUtilities::ArgumentReader::argv |
Points to the first argument denotation and will be incremented when a denotation has been processed.
Definition at line 20 of file argumentparserprivate.h.
bool ApplicationUtilities::ArgumentReader::completionMode |
Whether completion mode is enabled. In this case reading args will be continued even if an denotation is unknown (regardless of unknownArgumentBehavior()).
Definition at line 32 of file argumentparserprivate.h.
const char* const* ApplicationUtilities::ArgumentReader::end |
Points to the end of the argv array.
Definition at line 22 of file argumentparserprivate.h.
size_t ApplicationUtilities::ArgumentReader::index |
An index which is incremented when an argument is encountered (the current index is stored in the occurrence) or a value is encountered.
Definition at line 18 of file argumentparserprivate.h.
Argument* ApplicationUtilities::ArgumentReader::lastArg |
The last Argument instance which could be detected. Set to nullptr in the initial call. Used for Bash completion.
Definition at line 24 of file argumentparserprivate.h.
const char* const* ApplicationUtilities::ArgumentReader::lastArgDenotation |
Points to the element in argv where lastArg was encountered. Unspecified if lastArg is not set.
Definition at line 26 of file argumentparserprivate.h.
ArgumentParser& ApplicationUtilities::ArgumentReader::parser |
The associated ArgumentParser instance.
Definition at line 14 of file argumentparserprivate.h.