ROSE  0.9.9.168
Public Member Functions | Public Attributes | List of all members
Sawyer::CommandLine::Boost::options_description Struct Reference

Description

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 42 of file CommandLineBoost.h.

#include <CommandLineBoost.h>

Collaboration diagram for Sawyer::CommandLine::Boost::options_description:
Collaboration graph
[legend]

Public Member Functions

 options_description ()
 Construct an empty switch group without documentation. More...
 
 options_description (const std::string &title)
 Construct an empty switch group having a title. More...
 
options_descriptionadd_options ()
 Boost intermediate type for adding more switches. More...
 
options_descriptionadd (const options_description &other)
 Insert other switches into this group. More...
 
void print () const
 Print switch documentation. More...
 
options_descriptionoperator() (const std::string &switchName, const value< std::string > &, const std::string &doc)
 Declare a switch of specified type. More...
 
options_descriptionoperator() (const std::string &switchName, const value< int > &, const std::string &doc)
 Declare a switch of specified type. More...
 
options_descriptionoperator() (const std::string &switchName, const value< long int > &, const std::string &doc)
 Declare a switch of specified type. More...
 
options_descriptionoperator() (const std::string &switchName, const value< std::vector< int > > &, const std::string &doc)
 Declare a switch of specified type. More...
 
options_descriptionoperator() (const std::string &switchName, const value< std::vector< std::string > > &, const std::string &doc)
 Declare a switch of specified type. More...
 
options_descriptionoperator() (const std::string &switchName, const std::string &doc)
 Declare a switch of specified type. More...
 

Public Attributes

Sawyer::CommandLine::SwitchGroup sg
 The underlying Sawyer mechanism. More...
 

Constructor & Destructor Documentation

Sawyer::CommandLine::Boost::options_description::options_description ( )
inline

Construct an empty switch group without documentation.

Definition at line 47 of file CommandLineBoost.h.

Sawyer::CommandLine::Boost::options_description::options_description ( const std::string &  title)
inlineexplicit

Construct an empty switch group having a title.

Definition at line 50 of file CommandLineBoost.h.

Member Function Documentation

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.

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.

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.

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.

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.

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.

options_description& Sawyer::CommandLine::Boost::options_description::add_options ( )
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 73 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.

Member Data Documentation

Sawyer::CommandLine::SwitchGroup Sawyer::CommandLine::Boost::options_description::sg

The underlying Sawyer mechanism.

Definition at line 44 of file CommandLineBoost.h.


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