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 <CommandLineBoost.h>
|
| 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. More...
|
|
options_description & | add (const options_description &other) |
| Insert other switches into this group. More...
|
|
void | print () const |
| Print switch documentation. More...
|
|
|
options_description & | operator() (const std::string &switchName, const value< std::string > &, const std::string &doc) |
| Declare a switch of specified type. More...
|
|
options_description & | operator() (const std::string &switchName, const value< int > &, const std::string &doc) |
| Declare a switch of specified type. More...
|
|
options_description & | operator() (const std::string &switchName, const value< long int > &, const std::string &doc) |
| Declare a switch of specified type. More...
|
|
options_description & | operator() (const std::string &switchName, const value< std::vector< int > > &, const std::string &doc) |
| Declare a switch of specified type. More...
|
|
options_description & | operator() (const std::string &switchName, const value< std::vector< std::string > > &, const std::string &doc) |
| Declare a switch of specified type. More...
|
|
options_description & | operator() (const std::string &switchName, const std::string &doc) |
| Declare a switch of specified type. More...
|
|
◆ operator()() [1/6]
options_description& Sawyer::CommandLine::Boost::options_description::operator() |
( |
const std::string & |
switchName, |
|
|
const value< std::string > & |
, |
|
|
const std::string & |
doc |
|
) |
| |
Declare a switch of specified type.
As with boost (but not Sawyer) the type of the switch value is wrapped up in a template class called value.
There are often slightly different semantics possible depending on the declaration details, but all that is glossed over in this simple wrapper.
◆ operator()() [2/6]
options_description& Sawyer::CommandLine::Boost::options_description::operator() |
( |
const std::string & |
switchName, |
|
|
const value< int > & |
, |
|
|
const std::string & |
doc |
|
) |
| |
Declare a switch of specified type.
As with boost (but not Sawyer) the type of the switch value is wrapped up in a template class called value.
There are often slightly different semantics possible depending on the declaration details, but all that is glossed over in this simple wrapper.
◆ operator()() [3/6]
options_description& Sawyer::CommandLine::Boost::options_description::operator() |
( |
const std::string & |
switchName, |
|
|
const value< long int > & |
, |
|
|
const std::string & |
doc |
|
) |
| |
Declare a switch of specified type.
As with boost (but not Sawyer) the type of the switch value is wrapped up in a template class called value.
There are often slightly different semantics possible depending on the declaration details, but all that is glossed over in this simple wrapper.
◆ operator()() [4/6]
options_description& Sawyer::CommandLine::Boost::options_description::operator() |
( |
const std::string & |
switchName, |
|
|
const value< std::vector< int > > & |
, |
|
|
const std::string & |
doc |
|
) |
| |
Declare a switch of specified type.
As with boost (but not Sawyer) the type of the switch value is wrapped up in a template class called value.
There are often slightly different semantics possible depending on the declaration details, but all that is glossed over in this simple wrapper.
◆ operator()() [5/6]
options_description& Sawyer::CommandLine::Boost::options_description::operator() |
( |
const std::string & |
switchName, |
|
|
const value< std::vector< std::string > > & |
, |
|
|
const std::string & |
doc |
|
) |
| |
Declare a switch of specified type.
As with boost (but not Sawyer) the type of the switch value is wrapped up in a template class called value.
There are often slightly different semantics possible depending on the declaration details, but all that is glossed over in this simple wrapper.
◆ operator()() [6/6]
options_description& Sawyer::CommandLine::Boost::options_description::operator() |
( |
const std::string & |
switchName, |
|
|
const std::string & |
doc |
|
) |
| |
Declare a switch of specified type.
As with boost (but not Sawyer) the type of the switch value is wrapped up in a template class called value.
There are often slightly different semantics possible depending on the declaration details, but all that is glossed over in this simple wrapper.
◆ add_options()
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.
◆ add()
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.
◆ print()
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.
The documentation for this struct was generated from the following file: