ROSE 0.11.145.147
|
Replacement for basic use of boost::program_options::options_description.
The equivalent mechanism in Sawyer is a SwitchGroup that can hold declarations for zero or more switches.
Definition at line 43 of file CommandLineBoost.h.
#include <Sawyer/CommandLineBoost.h>
Public Member Functions | |
options_description () | |
Construct an empty switch group without documentation. | |
options_description (const std::string &title) | |
Construct an empty switch group having a title. | |
options_description & | add_options () |
Boost intermediate type for adding more switches. | |
options_description & | add (const options_description &other) |
Insert other switches into this group. | |
void | print () const |
Print switch documentation. | |
options_description & | operator() (const std::string &switchName, const value< std::string > &, const std::string &doc) |
Declare a switch of specified type. | |
options_description & | operator() (const std::string &switchName, const value< int > &, const std::string &doc) |
Declare a switch of specified type. | |
options_description & | operator() (const std::string &switchName, const value< long int > &, const std::string &doc) |
Declare a switch of specified type. | |
options_description & | operator() (const std::string &switchName, const value< std::vector< int > > &, const std::string &doc) |
Declare a switch of specified type. | |
options_description & | operator() (const std::string &switchName, const value< std::vector< std::string > > &, const std::string &doc) |
Declare a switch of specified type. | |
options_description & | operator() (const std::string &switchName, const std::string &doc) |
Declare a switch of specified type. | |
Public Attributes | |
Sawyer::CommandLine::SwitchGroup | sg |
The underlying Sawyer mechanism. | |
|
inline |
Construct an empty switch group without documentation.
Definition at line 48 of file CommandLineBoost.h.
|
inlineexplicit |
Construct an empty switch group having a title.
Definition at line 51 of file CommandLineBoost.h.
options_description & Sawyer::CommandLine::Boost::options_description::operator() | ( | const std::string & | switchName, |
const value< std::string > & | , | ||
const std::string & | doc | ||
) |
options_description & Sawyer::CommandLine::Boost::options_description::operator() | ( | const std::string & | switchName, |
const value< int > & | , | ||
const std::string & | doc | ||
) |
options_description & Sawyer::CommandLine::Boost::options_description::operator() | ( | const std::string & | switchName, |
const value< long int > & | , | ||
const std::string & | doc | ||
) |
options_description & Sawyer::CommandLine::Boost::options_description::operator() | ( | const std::string & | switchName, |
const value< std::vector< int > > & | , | ||
const std::string & | doc | ||
) |
options_description & Sawyer::CommandLine::Boost::options_description::operator() | ( | const std::string & | switchName, |
const value< std::vector< std::string > > & | , | ||
const std::string & | doc | ||
) |
options_description & Sawyer::CommandLine::Boost::options_description::operator() | ( | const std::string & | switchName, |
const std::string & | doc | ||
) |
|
inline |
Boost intermediate type for adding more switches.
Sawyer does not need an intermediate type for adding switches since it uses an "insert" method and has a dedicated Switch type to hold all the switch properties.
Definition at line 74 of file CommandLineBoost.h.
options_description & Sawyer::CommandLine::Boost::options_description::add | ( | const options_description & | other | ) |
Insert other switches into this group.
Copies the other
switches into this switch group without making any attempt to resolve conflicts when the other
group has switches with the same name as this group. If that happens, you might end up with one switch that parses a string and another that parses an integer, and depending on their order, the string declaration might hide the integer declarations since strings are a superset of integers.
void Sawyer::CommandLine::Boost::options_description::print | ( | ) | const |
Print switch documentation.
Sawyer normally produces manpage-style documentation for an entire program rather than line-oriented documentation for just a set of switch declarations. So in order to achieve the desired limited affect, this wrapper instantiates a temporary parser that contains these switches and nothing else.
Sawyer::CommandLine::SwitchGroup Sawyer::CommandLine::Boost::options_description::sg |
The underlying Sawyer mechanism.
Definition at line 45 of file CommandLineBoost.h.