ROSE
0.11.96.11
|
Parses a list of values.
Parses a list of values separated by specified regular expressions. Each member of the list may have its own parser and following separator. The final parser and separator are reused as often as necessary. The return value is a ParsedValue whose value is an STL list
with members that are the ParsedValue objects return by the list element parsers.
Definition at line 1319 of file util/Sawyer/CommandLine.h.
#include <CommandLine.h>
Public Types | |
typedef SharedPointer< ListParser > | Ptr |
Reference counting pointer for this class. | |
typedef std::list< ParsedValue > | ValueList |
Value type for list ParsedValue. | |
Public Types inherited from Sawyer::CommandLine::ValueParser | |
typedef SharedPointer< ValueParser > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
Ptr | nextMember (const ValueParser::Ptr &elmtType, const std::string &separatorRe="[,;:]\\s*") |
Specifies element type and separator. More... | |
Ptr | limit (size_t minLength, size_t maxLength) |
Specify limits for the number of values parsed. More... | |
Ptr | limit (size_t maxLength) |
Specify limits for the number of values parsed. More... | |
Ptr | exactly (size_t length) |
Specify limits for the number of values parsed. More... | |
Public Member Functions inherited from Sawyer::CommandLine::ValueParser | |
ParsedValue | matchString (const std::string &) |
Parse the entire string and return a value. More... | |
ParsedValue | match (Cursor &) |
Parse a value from the beginning of the specified string. More... | |
Ptr | valueSaver (const ValueSaver::Ptr &f) |
Property: functor responsible for saving a parsed value in user storage. More... | |
const ValueSaver::Ptr | valueSaver () const |
Property: functor responsible for saving a parsed value in user storage. More... | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. More... | |
SharedObject (const SharedObject &) | |
Copy constructor. More... | |
virtual | ~SharedObject () |
Virtual destructor. More... | |
SharedObject & | operator= (const SharedObject &) |
Assignment. More... | |
Public Member Functions inherited from Sawyer::SharedFromThis< ValueParser > | |
SharedPointer< ValueParser > | sharedFromThis () |
Create a shared pointer from this . More... | |
SharedPointer< const ValueParser > | sharedFromThis () const |
Create a shared pointer from this . More... | |
Static Public Member Functions | |
static Ptr | instance (const ValueParser::Ptr &firstElmtType, const std::string &separatorRe="[,;:]\\s*") |
Allocating constructor. More... | |
Protected Member Functions | |
ListParser (const ValueParser::Ptr &firstElmtType, const std::string &separatorRe) | |
Constructor for derived classes. More... | |
Protected Member Functions inherited from Sawyer::CommandLine::ValueParser | |
ValueParser () | |
Constructor for derived classes. More... | |
ValueParser (const ValueSaver::Ptr &valueSaver) | |
Constructor for derived classes. More... | |
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1327 of file util/Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
The firstElmtType
is the parser for the first value (and the remaining values also if no subsequent parser is specified), and the separatorRe
is the regular expression describing how values of this type are separated from subsequent values. The default separator is a comma, semicolon, or colon followed by zero or more white space characters. Users will most likely want to use the listParser factory instead, which takes the same arguments but requires less typing.
Definition at line 1345 of file util/Sawyer/CommandLine.h.
|
inline |
Specifies element type and separator.
Adds another element type and separator to this parser. The specified values are also used for all the following list members unless a subsequent type and separator are supplied. I.e., the final element type and separator are repeated as necessary when parsing. The default separator is a comma, semicolon, or colon followed by zero ore more white space characters.
Definition at line 1355 of file util/Sawyer/CommandLine.h.
Ptr Sawyer::CommandLine::ListParser::limit | ( | size_t | minLength, |
size_t | maxLength | ||
) |
Specify limits for the number of values parsed.
By default, a list parser parses zero or more values with no limit. The limit method provides separate lower and upper bounds (the one argument version sets only the upper bound), and the exactly method is a convenience to set the lower and upper bound to the same value.
|
inline |
Specify limits for the number of values parsed.
By default, a list parser parses zero or more values with no limit. The limit method provides separate lower and upper bounds (the one argument version sets only the upper bound), and the exactly method is a convenience to set the lower and upper bound to the same value.
Definition at line 1367 of file util/Sawyer/CommandLine.h.
References limit().
Referenced by limit().
|
inline |
Specify limits for the number of values parsed.
By default, a list parser parses zero or more values with no limit. The limit method provides separate lower and upper bounds (the one argument version sets only the upper bound), and the exactly method is a convenience to set the lower and upper bound to the same value.
Definition at line 1368 of file util/Sawyer/CommandLine.h.