ROSE  0.9.9.139
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);

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. More...
 
template<typename T >
AnyParser< T >::Ptr Sawyer::CommandLine::anyParser ()
 Factory for value parsers. More...
 
template<typename T >
IntegerParser< T >::Ptr Sawyer::CommandLine::integerParser (T &storage)
 Factory for value parsers. More...
 
template<typename T >
IntegerParser< T >::Ptr Sawyer::CommandLine::integerParser ()
 Factory for value parsers. More...
 
template<typename T >
NonNegativeIntegerParser< T >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser (T &storage)
 Factory for value parsers. More...
 
template<typename T >
NonNegativeIntegerParser< T >::Ptr Sawyer::CommandLine::nonNegativeIntegerParser ()
 Factory for value parsers. More...
 
template<typename T >
PositiveIntegerParser< T >::Ptr Sawyer::CommandLine::positiveIntegerParser (T &storage)
 Factory for value parsers. More...
 
template<typename T >
PositiveIntegerParser< T >::Ptr Sawyer::CommandLine::positiveIntegerParser ()
 Factory for value parsers. More...
 
template<typename T >
RealNumberParser< T >::Ptr Sawyer::CommandLine::realNumberParser (T &storage)
 Factory for value parsers. More...
 
template<typename T >
RealNumberParser< T >::Ptr Sawyer::CommandLine::realNumberParser ()
 Factory for value parsers. More...
 
template<typename T >
BooleanParser< T >::Ptr Sawyer::CommandLine::booleanParser (T &storage)
 Factory for value parsers. More...
 
template<typename T >
BooleanParser< T >::Ptr Sawyer::CommandLine::booleanParser ()
 Factory for value parsers. More...
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (T &storage)
 Factory for value parsers. More...
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (std::vector< T > &storage)
 Factory for value parsers. More...
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser (Optional< T > &storage)
 Factory for value parsers. More...
 
template<typename T >
EnumParser< T >::Ptr Sawyer::CommandLine::enumParser ()
 Factory for value parsers. More...
 
StringSetParser::Ptr Sawyer::CommandLine::stringSetParser (std::string &storage)
 Factory for value parsers. More...
 
StringSetParser::Ptr Sawyer::CommandLine::stringSetParser ()
 Factory for value parsers. More...
 
ListParser::Ptr Sawyer::CommandLine::listParser (const ValueParser::Ptr &, const std::string &sepRe="[,;:]\\s*")
 Factory for value parsers. More...
 

Function Documentation

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 1387 of file CommandLine.h.

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

Referenced by Sawyer::CommandLine::Switch::intrinsicValue().

template<typename T >
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

Definition at line 1391 of file CommandLine.h.

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

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 1397 of file CommandLine.h.

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

template<typename T >
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

Definition at line 1401 of file CommandLine.h.

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

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 1407 of file CommandLine.h.

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

template<typename T >
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

Definition at line 1411 of file CommandLine.h.

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

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 1417 of file CommandLine.h.

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

template<typename T >
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

Definition at line 1421 of file CommandLine.h.

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

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 1427 of file CommandLine.h.

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

template<typename T >
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

Definition at line 1431 of file CommandLine.h.

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

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 1437 of file CommandLine.h.

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

template<typename T >
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

Definition at line 1441 of file CommandLine.h.

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

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 1447 of file CommandLine.h.

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

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 1451 of file CommandLine.h.

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

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 1455 of file CommandLine.h.

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

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 1459 of file CommandLine.h.

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

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::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::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