CBMC
optionst Class Reference

#include <options.h>

+ Collaboration diagram for optionst:

Public Types

typedef std::list< std::string > value_listt
 
typedef std::map< std::string, value_listtoption_mapt
 

Public Member Functions

const std::string get_option (const std::string &option) const
 
bool get_bool_option (const std::string &option) const
 
signed int get_signed_int_option (const std::string &option) const
 
unsigned int get_unsigned_int_option (const std::string &option) const
 
const value_listtget_list_option (const std::string &option) const
 
bool is_set (const std::string &option) const
 N.B. opts.is_set("foo") does not imply opts.get_bool_option("foo") More...
 
void set_option (const std::string &option, const bool value)
 
void set_option (const std::string &option, const int value)
 
void set_option (const std::string &option, const unsigned value)
 
void set_option (const std::string &option, const std::string &value)
 
void set_option (const std::string &option, const char *value)
 
void set_option (const std::string &option, const value_listt &values)
 
 optionst ()
 
 ~optionst ()
 
optionstoperator= (const optionst &other)
 
json_objectt to_json () const
 Returns the options as JSON key value pairs. More...
 
xmlt to_xml () const
 Returns the options in XML format. More...
 
void output (std::ostream &out) const
 Outputs the options to out More...
 

Protected Attributes

option_mapt option_map
 
const value_listt empty_list
 

Detailed Description

Definition at line 22 of file options.h.

Member Typedef Documentation

◆ option_mapt

typedef std::map<std::string, value_listt> optionst::option_mapt

Definition at line 26 of file options.h.

◆ value_listt

typedef std::list<std::string> optionst::value_listt

Definition at line 25 of file options.h.

Constructor & Destructor Documentation

◆ optionst()

optionst::optionst ( )
inline

Definition at line 52 of file options.h.

◆ ~optionst()

optionst::~optionst ( )
inline

Definition at line 53 of file options.h.

Member Function Documentation

◆ get_bool_option()

bool optionst::get_bool_option ( const std::string &  option) const

Definition at line 44 of file options.cpp.

◆ get_list_option()

const optionst::value_listt & optionst::get_list_option ( const std::string &  option) const

Definition at line 80 of file options.cpp.

◆ get_option()

const std::string optionst::get_option ( const std::string &  option) const

Definition at line 67 of file options.cpp.

◆ get_signed_int_option()

signed int optionst::get_signed_int_option ( const std::string &  option) const

Definition at line 50 of file options.cpp.

◆ get_unsigned_int_option()

unsigned int optionst::get_unsigned_int_option ( const std::string &  option) const

Definition at line 56 of file options.cpp.

◆ is_set()

bool optionst::is_set ( const std::string &  option) const

N.B. opts.is_set("foo") does not imply opts.get_bool_option("foo")

Definition at line 62 of file options.cpp.

◆ operator=()

optionst& optionst::operator= ( const optionst other)
inline

Definition at line 55 of file options.h.

◆ output()

void optionst::output ( std::ostream &  out) const

Outputs the options to out

Definition at line 121 of file options.cpp.

◆ set_option() [1/6]

void optionst::set_option ( const std::string &  option,
const bool  value 
)

Definition at line 28 of file options.cpp.

◆ set_option() [2/6]

void optionst::set_option ( const std::string &  option,
const char *  value 
)
inline

Definition at line 42 of file options.h.

◆ set_option() [3/6]

void optionst::set_option ( const std::string &  option,
const int  value 
)

Definition at line 34 of file options.cpp.

◆ set_option() [4/6]

void optionst::set_option ( const std::string &  option,
const std::string &  value 
)

Definition at line 20 of file options.cpp.

◆ set_option() [5/6]

void optionst::set_option ( const std::string &  option,
const unsigned  value 
)

Definition at line 39 of file options.cpp.

◆ set_option() [6/6]

void optionst::set_option ( const std::string &  option,
const value_listt values 
)
inline

Definition at line 47 of file options.h.

◆ to_json()

json_objectt optionst::to_json ( ) const

Returns the options as JSON key value pairs.

Definition at line 93 of file options.cpp.

◆ to_xml()

xmlt optionst::to_xml ( ) const

Returns the options in XML format.

Definition at line 104 of file options.cpp.

Member Data Documentation

◆ empty_list

const value_listt optionst::empty_list
protected

Definition at line 67 of file options.h.

◆ option_map

option_mapt optionst::option_map
protected

Definition at line 66 of file options.h.


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