CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::Completer::Suboption Class Reference

#include <Complete.hh>

Detailed Description

A typical casm command takes 3 types of parameters: Option: Things like "super", "enum", "monte", etc Suboption: Anything that starts with "--" or "-", such as "--max" or "-z" Argument: The argument you pass to the suboption, such as an integer or filename

The Suboption class consists of a string to identify the –long option, a character to identify the -s(hort) version, and the type of arguments that are expected.

Definition at line 37 of file Complete.hh.

Public Types

typedef ArgHandler::ARG_TYPE ARG_TYPE
 

Public Member Functions

 Suboption (const std::string &init_longname, std::string init_short, ARG_TYPE init_expected_types)
 Explicit construction. Be sure to include "--" and '-' in the tags. More...
 
 Suboption (const po::option_description &init_boost_option)
 Construct with boost objects. More...
 
std::string long_tag () const
 Return long name in string format. More...
 
std::string short_tag () const
 Return short name as char. More...
 
bool matches (const std::string &test_tag) const
 
ARG_TYPE argument_type () const
 Return the expected types of arguments that follow *this. More...
 

Private Member Functions

void _sanity_throw () const
 Make sure values make sense. More...
 

Private Attributes

const std::string m_long
 –long identifier (includes leading "--") More...
 
const std::string m_short
 -s(hort) identifyer (includes leading '-') More...
 
const ARG_TYPE m_expected_arg
 Type of arguments expected. More...
 

Member Typedef Documentation

◆ ARG_TYPE

Constructor & Destructor Documentation

◆ Suboption() [1/2]

CASM::Completer::Suboption::Suboption ( const std::string &  init_longname,
std::string  init_short,
ARG_TYPE  init_expected_types 
)

Explicit construction. Be sure to include "--" and '-' in the tags.

Definition at line 48 of file Complete.cc.

◆ Suboption() [2/2]

CASM::Completer::Suboption::Suboption ( const po::option_description &  init_boost_option)

Construct with boost objects.

Definition at line 56 of file Complete.cc.

Member Function Documentation

◆ _sanity_throw()

void CASM::Completer::Suboption::_sanity_throw ( ) const
private

Make sure values make sense.

Definition at line 63 of file Complete.cc.

◆ argument_type()

ARG_TYPE CASM::Completer::Suboption::argument_type ( ) const

Return the expected types of arguments that follow *this.

Definition at line 94 of file Complete.cc.

◆ long_tag()

std::string CASM::Completer::Suboption::long_tag ( ) const

Return long name in string format.

Definition at line 76 of file Complete.cc.

◆ matches()

bool CASM::Completer::Suboption::matches ( const std::string &  test_tag) const

See if a provided string matches either the –long or -s(hort) tags. Expects leading '-' characters.

Definition at line 80 of file Complete.cc.

◆ short_tag()

std::string CASM::Completer::Suboption::short_tag ( ) const

Return short name as char.

Definition at line 78 of file Complete.cc.

Member Data Documentation

◆ m_expected_arg

const ARG_TYPE CASM::Completer::Suboption::m_expected_arg
private

Type of arguments expected.

Definition at line 69 of file Complete.hh.

◆ m_long

const std::string CASM::Completer::Suboption::m_long
private

–long identifier (includes leading "--")

Definition at line 63 of file Complete.hh.

◆ m_short

const std::string CASM::Completer::Suboption::m_short
private

-s(hort) identifyer (includes leading '-')

Definition at line 66 of file Complete.hh.


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