C++ Utilities  4.9.1
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
argumentparserprivate.h
Go to the documentation of this file.
1 #ifndef APPLICATION_UTILITIES_ARGUMENTPARSER_PRIVATE_H
2 #define APPLICATION_UTILITIES_ARGUMENTPARSER_PRIVATE_H
3 
4 namespace ApplicationUtilities {
5 
7 public:
8  ArgumentReader(ArgumentParser &parser, const char *const *argv, const char *const *end, bool completionMode = false);
9  ApplicationUtilities::ArgumentReader &reset(const char *const *argv, const char *const *end);
10  void read();
11  void read(ArgumentVector &args);
12 
18  size_t index;
20  const char *const *argv;
22  const char *const *end;
26  const char *const *lastArgDenotation;
28  const char *argDenotation;
30  unsigned char argDenotationType;
33 };
34 }
35 
36 #endif // APPLICATION_UTILITIES_ARGUMENTPARSER_PRIVATE_H
Argument * lastArg
The last Argument instance which could be detected. Set to nullptr in the initial call...
unsigned char argDenotationType
The type of the currently processed abbreviation denotation. Unspecified if argDenotation is not set...
Contains currently only ArgumentParser and related classes.
const char *const * argv
Points to the first argument denotation and will be incremented when a denotation has been processed...
const char * argDenotation
The currently processed abbreviation denotation (should be substring of one of the args in argv)...
ArgumentParser & parser
The associated ArgumentParser instance.
size_t index
An index which is incremented when an argument is encountered (the current index is stored in the occ...
The Argument class is a wrapper for command line argument information.
ArgumentVector & args
The Argument instances to store the results. Sub arguments of args are considered as well...
const char *const * end
Points to the end of the argv array.
const char *const * lastArgDenotation
Points to the element in argv where lastArg was encountered. Unspecified if lastArg is not set...
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.
bool completionMode
Whether completion mode is enabled. In this case reading args will be continued even if an denotation...
The ArgumentParser class provides a means for handling command line arguments.
std::vector< Argument * > ArgumentVector