22 using StringType = value_type;
25 const StringType original;
27 std::vector <StringType::size_type> remainder_start;
35 inline StringType
remainder (size_type index)
const {
36 assert (index >= 0 && index < size());
37 return original.substr (remainder_start [index]);
44 ArgumentVector::size_type point = 0;
63 return point >= argv->size();
71 inline ArgvCursor operator++(
int) {
72 ArgvCursor prior { *
this };
77 inline ArgvCursor operator+(
int value)
const {
78 ArgvCursor result { *
this };
79 result.point +=
value;
83 inline ArgvCursor operator-(
int value)
const {
85 ArgvCursor result { *
this };
86 result.point -=
value;
91 inline const ArgumentVector::StringType &
value ()
const {
92 assert (point >= 0 && point < argv->size());
93 return (*argv) [point];
98 assert (point >= 0 && point < argv->size());
101 std::vector <ArgumentVector::StringType> remainingTokens ()
const;
This class lexically analyzes a string, splitting it up into tokens, which are accessed as a vector.
Definition parsnip_argv.h:19
StringType remainder(size_type index) const
Retrieve the raw, untokenized remainder of the string.
Definition parsnip_argv.h:35
An iterator for argument vectors.
Definition parsnip_argv.h:42
bool isEnd() const
Check if the cursor is at the end of the command line.
Definition parsnip_argv.h:62
bool isStart() const
Check if the cursor is at the start of the command line.
Definition parsnip_argv.h:55
const ArgumentVector::StringType & value() const
Return the current token.
Definition parsnip_argv.h:91
const ArgumentVector::StringType remainingString() const
Return the raw, unsplit remainder of the command line.
Definition parsnip_argv.h:97
Serialization and parsing library.
Definition parsnip.h:38