ROSE  0.11.96.11
Public Types | Static Public Member Functions | Protected Member Functions | List of all members
Sawyer::CommandLine::StringSetParser Class Reference

Description

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.

See also
Command line parser factories

Definition at line 1229 of file util/Sawyer/CommandLine.h.

#include <CommandLine.h>

Inheritance diagram for Sawyer::CommandLine::StringSetParser:
Inheritance graph
[legend]
Collaboration diagram for Sawyer::CommandLine::StringSetParser:
Collaboration graph
[legend]

Public Types

typedef SharedPointer< StringSetParserPtr
 Reference counting pointer for this class.
 
- Public Types inherited from Sawyer::CommandLine::ValueParser
typedef SharedPointer< ValueParserPtr
 Reference counting pointer for this class.
 

Public Member Functions

Ptr with (const std::string &s)
 Adds string members. More...
 
Ptr with (const std::vector< std::string > sv)
 Adds string members. More...
 
template<class InputIterator >
Ptr with (InputIterator begin, InputIterator end)
 Adds string 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...
 
SharedObjectoperator= (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

 StringSetParser ()
 Constructor for derived classes. More...
 
 StringSetParser (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...
 

Constructor & Destructor Documentation

◆ StringSetParser() [1/2]

Sawyer::CommandLine::StringSetParser::StringSetParser ( )
inlineprotected

Constructor for derived classes.

Non-subclass users should use instance instead.

Definition at line 1235 of file util/Sawyer/CommandLine.h.

◆ StringSetParser() [2/2]

Sawyer::CommandLine::StringSetParser::StringSetParser ( const ValueSaver::Ptr valueSaver)
inlineprotected

Constructor for derived classes.

Non-subclass users should use instance instead.

Definition at line 1238 of file util/Sawyer/CommandLine.h.

Member Function Documentation

◆ instance() [1/2]

static Ptr Sawyer::CommandLine::StringSetParser::instance ( )
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.

See also
Command line parser factories

Definition at line 1246 of file util/Sawyer/CommandLine.h.

◆ instance() [2/2]

static Ptr Sawyer::CommandLine::StringSetParser::instance ( const ValueSaver::Ptr valueSaver)
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.

See also
Command line parser factories

Definition at line 1251 of file util/Sawyer/CommandLine.h.

◆ with() [1/3]

Ptr Sawyer::CommandLine::StringSetParser::with ( const std::string &  s)
inline

Adds string members.

Inserts an additional string to be recognized in the input.

Definition at line 1255 of file util/Sawyer/CommandLine.h.

References with().

Referenced by with().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ with() [2/3]

Ptr Sawyer::CommandLine::StringSetParser::with ( const std::vector< std::string >  sv)
inline

Adds string members.

Inserts an additional string to be recognized in the input.

Definition at line 1256 of file util/Sawyer/CommandLine.h.

References with().

Referenced by with().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ with() [3/3]

template<class InputIterator >
Ptr Sawyer::CommandLine::StringSetParser::with ( InputIterator  begin,
InputIterator  end 
)
inline

Adds string members.

Inserts an additional string to be recognized in the input.

Definition at line 1258 of file util/Sawyer/CommandLine.h.

References Sawyer::SharedPointer< T >::dynamicCast().

Here is the call graph for this function:

The documentation for this class was generated from the following file: