Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::program_options::basic_option< charT > Class Template Reference

Option found in input source. More...

#include <option.hpp>

Inheritance diagram for boost::program_options::basic_option< charT >:
Collaboration diagram for boost::program_options::basic_option< charT >:

Public Member Functions

 basic_option ()
 
 basic_option (const std::string &xstring_key, const std::vector< std::string > &xvalue)
 

Public Attributes

std::string string_key
 String key of this option. More...
 
int position_key
 Position key of this option. More...
 
std::vector< std::basic_string
< charT > > 
value
 Option's value. More...
 
std::vector< std::basic_string
< charT > > 
original_tokens
 The original unchanged tokens this option was created from. More...
 
bool unregistered
 True if option was not recognized. More...
 
bool case_insensitive
 True if string_key has to be handled case insensitive. More...
 

Detailed Description

template<class charT>
class boost::program_options::basic_option< charT >

Option found in input source.

Contains a key and a value. The key, in turn, can be a string (name of an option), or an integer (position in input source) – in case no name is specified. The latter is only possible for command line. The template parameter specifies the type of char used for storing the option's value.

Constructor & Destructor Documentation

template<class charT>
boost::program_options::basic_option< charT >::basic_option ( )
inline
template<class charT>
boost::program_options::basic_option< charT >::basic_option ( const std::string &  xstring_key,
const std::vector< std::string > &  xvalue 
)
inline

Member Data Documentation

template<class charT>
bool boost::program_options::basic_option< charT >::case_insensitive

True if string_key has to be handled case insensitive.

template<class charT>
std::vector< std::basic_string<charT> > boost::program_options::basic_option< charT >::original_tokens

The original unchanged tokens this option was created from.

template<class charT>
int boost::program_options::basic_option< charT >::position_key

Position key of this option.

All options without an explicit name are sequentially numbered starting from 0. If an option has explicit name, 'position_key' is equal to -1. It is possible that both position_key and string_key is specified, in case name is implicitly added.

template<class charT>
std::string boost::program_options::basic_option< charT >::string_key

String key of this option.

Intentionally independent of the template parameter.

template<class charT>
bool boost::program_options::basic_option< charT >::unregistered

True if option was not recognized.

In that case, 'string_key' and 'value' are results of purely syntactic parsing of source. The original tokens can be recovered from the "original_tokens" member.

template<class charT>
std::vector< std::basic_string<charT> > boost::program_options::basic_option< charT >::value

Option's value.


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