|
ROSE
0.11.96.11
|
Parses an enumerated constant.
Parses one of the strings added via with and returns the associated enumerated constant. The template parameter T is the enum type. Returns A ParsedValue whose value if type T. This parser uses StringSetParser, thus it prefers to match enum members with the longest names.
Definition at line 1276 of file util/Sawyer/CommandLine.h.
#include <CommandLine.h>


Public Types | |
| typedef SharedPointer< EnumParser > | 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 &name, T value) |
| Adds enum members. 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 () |
| Allocating constructor. More... | |
| static Ptr | instance (const ValueSaver::Ptr &valueSaver) |
| Allocating constructor. More... | |
Protected Member Functions | |
| EnumParser () | |
| Constructor for derived classes. More... | |
| EnumParser (const ValueSaver::Ptr &valueSaver) | |
| 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 1281 of file util/Sawyer/CommandLine.h.
Referenced by Sawyer::CommandLine::EnumParser< T >::instance().

|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1284 of file util/Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new EnumParser object. Uses will most likely want to use the enumParser factory instead, which requires less typing.
Definition at line 1292 of file util/Sawyer/CommandLine.h.
Referenced by Sawyer::CommandLine::enumParser().

|
inlinestatic |
Allocating constructor.
Returns a pointer to a new EnumParser object. Uses will most likely want to use the enumParser factory instead, which takes the same arguments, but requires less typing.
Definition at line 1297 of file util/Sawyer/CommandLine.h.
References Sawyer::CommandLine::EnumParser< T >::EnumParser(), and Sawyer::CommandLine::ValueParser::valueSaver().

|
inline |
Adds enum members.
Inserts an additional enumeration constant and its string name.
Definition at line 1300 of file util/Sawyer/CommandLine.h.
References Sawyer::Container::Map< K, T, Cmp, Alloc >::insert(), and Sawyer::SharedFromThis< ValueParser >::sharedFromThis().

1.8.17