ROSE 0.11.145.192
|
Parses any one of a set of strings.
Recognizes any of the strings register via with method and returns a ParsedValue of type std::string
for the string that was matched. Longer matches are preferred over shorter matches; if the input contains "bandana" and the parser knows about "ban", "band", and "bandana", it will match "bandana". The return value is a ParsedValue whose value is an std::string
.
Definition at line 1229 of file Sawyer/CommandLine.h.
#include <Sawyer/CommandLine.h>
Public Types | |
typedef SharedPointer< StringSetParser > | Ptr |
Reference counting pointer for this class. | |
Public Types inherited from Sawyer::CommandLine::ValueParser | |
typedef SharedPointer< ValueParser > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
Ptr | with (const std::string &s) |
Adds string members. | |
Ptr | with (const std::vector< std::string > sv) |
Adds string members. | |
template<class InputIterator > | |
Ptr | with (InputIterator begin, InputIterator end) |
Adds string members. | |
Public Member Functions inherited from Sawyer::CommandLine::ValueParser | |
ParsedValue | matchString (const std::string &) |
Parse the entire string and return a value. | |
ParsedValue | match (Cursor &) |
Parse a value from the beginning of the specified string. | |
Ptr | valueSaver (const ValueSaver::Ptr &f) |
Property: functor responsible for saving a parsed value in user storage. | |
const ValueSaver::Ptr | valueSaver () const |
Property: functor responsible for saving a parsed value in user storage. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Public Member Functions inherited from Sawyer::SharedFromThis< ValueParser > | |
SharedPointer< ValueParser > | sharedFromThis () |
Create a shared pointer from this . | |
SharedPointer< const ValueParser > | sharedFromThis () const |
Create a shared pointer from this . | |
Static Public Member Functions | |
static Ptr | instance () |
Allocating constructor. | |
static Ptr | instance (const ValueSaver::Ptr &valueSaver) |
Allocating constructor. | |
Protected Member Functions | |
StringSetParser () | |
Constructor for derived classes. | |
StringSetParser (const ValueSaver::Ptr &valueSaver) | |
Constructor for derived classes. | |
Protected Member Functions inherited from Sawyer::CommandLine::ValueParser | |
ValueParser () | |
Constructor for derived classes. | |
ValueParser (const ValueSaver::Ptr &valueSaver) | |
Constructor for derived classes. | |
Reference counting pointer for this class.
Definition at line 1241 of file Sawyer/CommandLine.h.
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1235 of file Sawyer/CommandLine.h.
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1238 of file Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new StringSetParser object. Uses will most likely want to use the stringSetParser factory instead, which requires less typing.
Definition at line 1246 of file Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new StringSetParser object. Uses will most likely want to use the stringSetParser factory instead, which takes the same arguments, but requires less typing.
Definition at line 1251 of file Sawyer/CommandLine.h.
|
inline |
Adds string members.
Inserts an additional string to be recognized in the input.
Definition at line 1255 of file Sawyer/CommandLine.h.
References with().
Referenced by with().
|
inline |
Adds string members.
Inserts an additional string to be recognized in the input.
Definition at line 1256 of file Sawyer/CommandLine.h.
References with().
Referenced by with().
|
inline |
Adds string members.
Inserts an additional string to be recognized in the input.
Definition at line 1258 of file Sawyer/CommandLine.h.
References Sawyer::SharedPointer< T >::dynamicCast().