ROSE 0.11.145.192
Command line parser factories

Description

Factories for creating instances of Sawyer::CommandLine::ValueParser subclasses.

A factory function is a more terse and convenient way of calling the instance allocating constructors for the various subclasses of ValueParser, and they sometimes alleviate the user from having to specify template arguments. They take the same arguments as the instance method(s) and have the same name as the class they return, except their initial letter is lower case. These two calls are equivalent:

ValueParser::Ptr parser1 = IntegerParser::instance<short>(storage);
ValueParser::Ptr parser2 = integerParser(storage);
SharedPointer< ValueParser > Ptr
Reference counting pointer for this class.
IntegerParser< T >::Ptr integerParser()
Factory for value parsers.

Most parser factories come in three varieties:

The integerParser factory is an example for all three of these varieties:

integerParser() // saves an int value in ParserResult
integerParser<short>() // saves a short value in ParserResult
long result;
integerParser(result); // saves a long value in ParserResult and in result
std::vector<int> results;
integerParser(results); // saves more than one integer

Factories

Collaboration diagram for Command line parser factories:
template<typename T >
AnyParser< T >::Ptr Sawyer::CommandLine::anyParser (T &storage)
 Factory for value parsers.
 
template<typename T >
AnyParser< T >::Ptr Sawyer::CommandLine::anyParser ()
 Factory for value parsers.
 
AnyParser< std::string >::Ptr Sawyer::CommandLine::anyParser ()
 Factory for value parsers.
 
template<typename T >
IntegerParser< T >::Ptr Sawyer::CommandLine::integerParser (T &storage)
 Factory for value parsers.
 
template<typename T >
IntegerParser< T >::Ptr Sawyer::CommandLine::integerParser ()
 Factory for value parsers.
 
IntegerParser< int >::Ptr Sawyer::CommandLine::integerParser ()
 Factory for value parsers.
 
template<typename T >
NonNegativeIntegerParser< T >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser (T &storage)
 Factory for value parsers.
 
template<typename T >
NonNegativeIntegerParser< T >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser ()
 Factory for value parsers.
 
NonNegativeIntegerParser< unsigned >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser ()
 Factory for value parsers.
 
template<typename T >
PositiveIntegerParser< T >::Ptr Sawyer::CommandLine::positiveIntegerParser (T &storage)
 Factory for value parsers.
 
template<typename T >
PositiveIntegerParser< T >::Ptr Sawyer::CommandLine::positiveIntegerParser ()
 Factory for value parsers.
 
PositiveIntegerParser< unsigned >::Ptr Sawyer::CommandLine::positiveIntegerParser ()
 Factory for value parsers.
 
template<typename T >
RealNumberParser< T >::Ptr Sawyer::CommandLine::realNumberParser (T &storage)
 Factory for value parsers.
 
template<typename T >
RealNumberParser< T >::Ptr Sawyer::CommandLine::realNumberParser ()
 Factory for value parsers.
 
RealNumberParser< double >::Ptr Sawyer::CommandLine::realNumberParser ()
 Factory for value parsers.
 
template<typename T >
BooleanParser< T >::Ptr Sawyer::CommandLine::booleanParser (T &storage)
 Factory for value parsers.
 
template<typename T >
BooleanParser< T >::Ptr Sawyer::CommandLine::booleanParser ()
 Factory for value parsers.
 
BooleanParser< bool >::Ptr Sawyer::CommandLine::booleanParser ()
 Factory for value parsers.
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (T &storage)
 Factory for value parsers.
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (std::vector< T > &storage)
 Factory for value parsers.
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (Optional< T > &storage)
 Factory for value parsers.
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (BitFlags< T > &storage)
 Factory for value parsers.
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ()
 Factory for value parsers.
 
StringSetParser::Ptr Sawyer::CommandLine::stringSetParser (std::string &storage)
 Factory for value parsers.
 
StringSetParser::Ptr Sawyer::CommandLine::stringSetParser ()
 Factory for value parsers.
 
ListParser::Ptr Sawyer::CommandLine::listParser (const ValueParser::Ptr &, const std::string &sepRe="[,;:]\\s*")
 Factory for value parsers.
 

Function Documentation

◆ anyParser() [1/3]

template<typename T >
AnyParser< T >::Ptr Sawyer::CommandLine::anyParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1430 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::AnyParser< T >::instance().

Referenced by Sawyer::CommandLine::SwitchArgument::SwitchArgument(), Sawyer::CommandLine::Switch::argument(), and Sawyer::CommandLine::Switch::intrinsicValue().

◆ anyParser() [2/3]

template<typename T >
AnyParser< T >::Ptr Sawyer::CommandLine::anyParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1434 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::AnyParser< T >::instance().

◆ anyParser() [3/3]

AnyParser< std::string >::Ptr Sawyer::CommandLine::anyParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ integerParser() [1/3]

template<typename T >
IntegerParser< T >::Ptr Sawyer::CommandLine::integerParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1440 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::IntegerParser< T >::instance().

◆ integerParser() [2/3]

template<typename T >
IntegerParser< T >::Ptr Sawyer::CommandLine::integerParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1444 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::IntegerParser< T >::instance().

◆ integerParser() [3/3]

IntegerParser< int >::Ptr Sawyer::CommandLine::integerParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ nonNegativeIntegerParser() [1/3]

template<typename T >
NonNegativeIntegerParser< T >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1450 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::NonNegativeIntegerParser< T >::instance().

◆ nonNegativeIntegerParser() [2/3]

template<typename T >
NonNegativeIntegerParser< T >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1454 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::NonNegativeIntegerParser< T >::instance().

◆ nonNegativeIntegerParser() [3/3]

NonNegativeIntegerParser< unsigned >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ positiveIntegerParser() [1/3]

template<typename T >
PositiveIntegerParser< T >::Ptr Sawyer::CommandLine::positiveIntegerParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1460 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::PositiveIntegerParser< T >::instance().

◆ positiveIntegerParser() [2/3]

template<typename T >
PositiveIntegerParser< T >::Ptr Sawyer::CommandLine::positiveIntegerParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1464 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::PositiveIntegerParser< T >::instance().

◆ positiveIntegerParser() [3/3]

PositiveIntegerParser< unsigned >::Ptr Sawyer::CommandLine::positiveIntegerParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ realNumberParser() [1/3]

template<typename T >
RealNumberParser< T >::Ptr Sawyer::CommandLine::realNumberParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1470 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::RealNumberParser< T >::instance().

◆ realNumberParser() [2/3]

template<typename T >
RealNumberParser< T >::Ptr Sawyer::CommandLine::realNumberParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1474 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::RealNumberParser< T >::instance().

◆ realNumberParser() [3/3]

RealNumberParser< double >::Ptr Sawyer::CommandLine::realNumberParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ booleanParser() [1/3]

template<typename T >
BooleanParser< T >::Ptr Sawyer::CommandLine::booleanParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1480 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::BooleanParser< T >::instance().

◆ booleanParser() [2/3]

template<typename T >
BooleanParser< T >::Ptr Sawyer::CommandLine::booleanParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1484 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::BooleanParser< T >::instance().

◆ booleanParser() [3/3]

BooleanParser< bool >::Ptr Sawyer::CommandLine::booleanParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ enumParser() [1/5]

template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ( T &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1490 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::EnumParser< T >::instance().

◆ enumParser() [2/5]

template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ( std::vector< T > &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1494 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::EnumParser< T >::instance().

◆ enumParser() [3/5]

template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ( Optional< T > &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1498 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::EnumParser< T >::instance().

◆ enumParser() [4/5]

template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ( BitFlags< T > &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1502 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::EnumParser< T >::instance().

◆ enumParser() [5/5]

template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

Definition at line 1506 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::EnumParser< T >::instance().

◆ stringSetParser() [1/2]

StringSetParser::Ptr Sawyer::CommandLine::stringSetParser ( std::string &  storage)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ stringSetParser() [2/2]

StringSetParser::Ptr Sawyer::CommandLine::stringSetParser ( )

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also

◆ listParser()

ListParser::Ptr Sawyer::CommandLine::listParser ( const ValueParser::Ptr ,
const std::string &  sepRe = "[,;:]\\s*" 
)

Factory for value parsers.

A factory function is a more terse and convenient way of calling the instance allocating constructors for ValueParser subclasses and often alleviates the user from having to specify template arguments. Most parser factories come in two varieties, and some in three varieties.

See also