Rosetta  2019.31
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | List of all members
utility::options::BooleanOption Class Reference

Program boolean option class. More...

#include <BooleanOption.hh>

Inheritance diagram for utility::options::BooleanOption:
Inheritance graph
[legend]

Public Member Functions

 BooleanOption ()
 Default constructor. More...
 
 BooleanOption (BooleanOptionKey const &key_a, std::string const &description_a)
 Key + description constructor. More...
 
BooleanOptionclone () const override
 Clone this. More...
 
 ~BooleanOption ()
 Destructor. More...
 
bool is_value (std::string const &value_str) const override
 Is a string readable as this option's value type? More...
 
bool is_cl_value (std::string const &value_str) const override
 Is a string readable as this option's value type and a legal command line value? More...
 
std::string type_string () const override
 Option type code string representation. More...
 
std::string legal_string () const override
 Legal value string representation. More...
 
std::string default_string () const override
 Default value string representation. More...
 
std::string value_string () const override
 Value string representation. More...
 
std::string equals_string () const override
 =Value string representation More...
 
- Public Member Functions inherited from utility::options::ScalarOption_T_< BooleanOptionKey, bool >
 ~ScalarOption_T_ ()
 Destructor. More...
 
void copy_from (Option const &other) override
 Copy operation. More...
 
 operator Value const & () const
 Value conversion. More...
 
ScalarOption_T_activate () override
 Activate. More...
 
ScalarOption_T_deactivate () override
 Deactivate. More...
 
ScalarOption_T_to_default () override
 Set to default value, if any. More...
 
ScalarOption_T_clear () override
 Clear. More...
 
ScalarOption_T_legal (Value const &value_a)
 Add a legal value. More...
 
bool legal () const override
 Legal value? More...
 
ScalarOption_T_shortd (std::string const &s)
 Set a short description. More...
 
ScalarOption_T_lower (Value const &value_a)
 Set a lower bound. More...
 
LegalBound const & lower () const
 Lower bound. More...
 
ScalarOption_T_strict_lower (Value const &value_a)
 Set a strict lower bound. More...
 
ScalarOption_T_upper (Value const &value_a)
 Set an upper bound. More...
 
LegalBound const & upper ()
 Upper bound. More...
 
ScalarOption_T_strict_upper (Value const &value_a)
 Set a strict upper bound. More...
 
virtual ScalarOption_T_default_value (Value const &value_a)
 Default value assignment. More...
 
Value const & default_value () const
 Default value. More...
 
virtual ScalarOption_T_def (Value const &value_a)
 Default value assignment. More...
 
ScalarOption_T_cl_value (std::string const &value_str) override
 Value assignment from a command line string. More...
 
virtual ScalarOption_T_value (Value const &value_a)
 Value assignment. More...
 
Value const & value () const
 Value. More...
 
virtual ScalarOption_T_operator() (Value const &value_a)
 Value assignment. More...
 
Value const & operator() () const
 Value. More...
 
ScalarOption_T_default_to (ScalarOption_T_ const &option)
 Default to another option's value. More...
 
bool legal_specs_report () const override
 Legal specifications check: Report and return error state. More...
 
bool legal_limits_report () const override
 Legal value limits check: Report and return error state. More...
 
bool legal_size_report () const override
 Legal size limits check: Report and return error state. More...
 
bool legal_default_report () const override
 Legal default value check: Report and return error state. More...
 
void legal_default_check () const override
 Legal default value check. More...
 
void legal_default_check (Value const &value_a) const
 Legal default value check. More...
 
bool legal_report () const override
 Legal value check: Report and return error state. More...
 
void legal_check () const override
 Legal value check. More...
 
void legal_check (Value const &value_a) const
 Legal value check. More...
 
bool specified_report () const override
 Required specified option check: Report and return error state. More...
 
void specified_check () const override
 Required specified option check. More...
 
Key const & key () const override
 Key. More...
 
std::string const & id () const override
 ID. More...
 
std::string const & identifier () const override
 Identifier. More...
 
std::string const & code () const override
 Code. More...
 
std::string const & name () const override
 Name. More...
 
std::string const & description () const override
 Description. More...
 
void description (std::string const &sd)
 
std::string const & short_description () const override
 Short Description. More...
 
void short_description (std::string const &sd)
 
bool legal_default () const override
 Legal or inactive default value? More...
 
bool legal_value (Value const &value_a) const
 Is the given value legal? More...
 
bool has_default () const override
 Has a default? More...
 
bool default_active () const override
 Default active? More...
 
bool default_inactive () const override
 Default inactive? More...
 
bool active () const override
 Active? That is, the option has some value, either the default one or specified on the command line. More...
 
bool user () const override
 User-specified? That is, the option value was specified on the command line. You should probably use active() instead in almost all cases! More...
 
bool can_hold_another () const override
 Can another value be added and stay within any size constraints? More...
 
Size default_size () const override
 Default size (number of default values) More...
 
Size n_default_value () const override
 Number of default values (default size) More...
 
Size size () const override
 Size (number of values) More...
 
Size n_value () const override
 Number of values (size) More...
 
bool has_any_of_characters (std::string const &str1, std::string const &s) const
 Has Any Character of a std::string? non ambiguous vesrion for Python binding. More...
 
std::string legal_string (bool const ) const
 Legal value string representation. More...
 
std::string legal_string () const override
 Legal value string representation. More...
 
std::string size_constraint_string () const override
 Size constraint string representation. More...
 
std::string default_string () const override
 Default value string representation. More...
 
std::string raw_default_string () const override
 Default value string representation. More...
 
std::string value_string () const override
 Value string representation. More...
 
std::string raw_value_string () const override
 Value string representation. More...
 
std::string equals_string () const override
 =Value string representation More...
 
Value value_or (Value const &value_a) const
 Value or passed default if inactive. More...
 
Value user_or (Value const &value_a) const
 Value or passed default if not user-specified. More...
 
- Public Member Functions inherited from utility::options::ScalarOption
 ~ScalarOption ()
 Destructor. More...
 
void set_value (std::string const &value_str, bool=false) override
 Value assignment from full string. More...
 
void set_cl_value (std::string const &value_str) override
 Value assignemt from a command line string but without a ScalarOption & return type. More...
 
- Public Member Functions inherited from utility::options::Option
virtual ~Option ()
 Destructor. More...
 
Optionis_group (bool value)
 
bool is_group () const
 Is this the synonymous option for an option group (e.g. -in:file:file) More...
 
void been_accessed () const
 Set access property to true. More...
 
void set_accessed (bool setting) const
 
bool is_been_accessed () const
 Return true if option value was anyhow accessed. More...
 
Optionrestrict_access (bool setting)
 Restrict direct access to option for general use. More...
 
void check_restricted_access (bool do_check) const
 

Static Public Member Functions

static BooleanOption NoDefault (BooleanOptionKey const &key_a, std::string const &description_a)
 Key + description no-default named constructor. More...
 

Protected Member Functions

Value value_of (std::string const &value_str) const override
 Value of a string. More...
 
bool is_true_value (std::string const &value_str) const
 String accepted as a true value? More...
 
bool is_false_value (std::string const &value_str) const
 String accepted as a false value? More...
 
- Protected Member Functions inherited from utility::options::ScalarOption_T_< BooleanOptionKey, bool >
 ScalarOption_T_ ()
 Default constructor. More...
 
 ScalarOption_T_ (ScalarOption_T_ const &option)
 Copy constructor. More...
 
 ScalarOption_T_ (Key const &key_a, std::string const &description_a)
 Key + description constructor. More...
 
ScalarOption_T_operator= (ScalarOption_T_ const &option)
 Copy assignment. More...
 
virtual std::string value_string_of (Value const &v) const
 String representation of a given value. More...
 
void default_inactive_error () const
 Error handler for using inactive option value. More...
 
void inactive_error () const
 Error handler for using inactive option value. More...
 
virtual void stream_setup (std::ostream &) const
 Setup stream state for the Option value type. More...
 
bool unconstrained () const
 Value is unconstrained? More...
 
bool default_is_legal () const
 Default value is a specified legal value? More...
 
bool value_is_legal () const
 Value is a specified legal value? More...
 
bool value_is_legal (Value const &value_a) const
 Value is legal? More...
 
bool default_obeys_bounds () const
 Default value obeys specified bounds? More...
 
bool value_obeys_bounds () const
 Value obeys specified bounds? More...
 
bool value_obeys_bounds (Value const &value_a) const
 Given value obeys specified bounds? More...
 
- Protected Member Functions inherited from utility::options::ScalarOption
 ScalarOption ()
 Default constructor. More...
 
 ScalarOption (ScalarOption const &)=default
 Copy constructor. More...
 
ScalarOptionoperator= (ScalarOption const &)
 Copy assignment. More...
 
- Protected Member Functions inherited from utility::options::Option
 Option ()
 Default constructor. More...
 
 Option (Option const &option)
 Copy constructor. More...
 
Optionoperator= (Option const &option)
 Copy assignment. More...
 

Private Types

typedef ScalarOption_T_
< BooleanOptionKey, bool
Super
 

Private Member Functions

 BooleanOption (BooleanOptionKey const &key_a, std::string const &description_a, bool const set_default)
 Key + description default control constructor. More...
 

Additional Inherited Members

- Public Types inherited from utility::options::ScalarOption_T_< BooleanOptionKey, bool >
typedef BooleanOptionKey key_type
 
typedef bool value_type
 
typedef BooleanOptionKey Key
 
typedef bool Value
 
- Public Types inherited from utility::options::Option
typedef OptionKey key_type
 
typedef std::size_t size_type
 
typedef OptionKey Key
 
typedef std::size_t Size
 
- Protected Types inherited from utility::options::Option
enum  State { INACTIVE, DEFAULT, USER }
 Option state enumeration. More...
 

Detailed Description

Program boolean option class.

Member Typedef Documentation

Constructor & Destructor Documentation

utility::options::BooleanOption::BooleanOption ( )
inline

Default constructor.

Referenced by clone(), and NoDefault().

utility::options::BooleanOption::BooleanOption ( BooleanOptionKey const &  key_a,
std::string const &  description_a 
)
inline
utility::options::BooleanOption::~BooleanOption ( )
inline

Destructor.

utility::options::BooleanOption::BooleanOption ( BooleanOptionKey const &  key_a,
std::string const &  description_a,
bool const  set_default 
)
inlineprivate

Key + description default control constructor.

References utility::options::ScalarOption_T_< BooleanOptionKey, bool >::default_value().

Member Function Documentation

BooleanOption* utility::options::BooleanOption::clone ( ) const
inlineoverridevirtual
std::string utility::options::BooleanOption::default_string ( ) const
inlineoverridevirtual

Default value string representation.

Implements utility::options::Option.

std::string utility::options::BooleanOption::equals_string ( ) const
inlineoverridevirtual
bool utility::options::BooleanOption::is_cl_value ( std::string const &  value_str) const
inlineoverridevirtual

Is a string readable as this option's value type and a legal command line value?

Implements utility::options::Option.

References is_value().

bool utility::options::BooleanOption::is_false_value ( std::string const &  value_str) const
inlineprotected

String accepted as a false value?

References utility::is_false_string().

Referenced by is_value(), and value_of().

bool utility::options::BooleanOption::is_true_value ( std::string const &  value_str) const
inlineprotected

String accepted as a true value?

References utility::is_true_string().

Referenced by is_value(), and value_of().

bool utility::options::BooleanOption::is_value ( std::string const &  value_str) const
inlineoverridevirtual

Is a string readable as this option's value type?

Implements utility::options::Option.

References is_false_value(), and is_true_value().

Referenced by is_cl_value().

std::string utility::options::BooleanOption::legal_string ( ) const
inlineoverridevirtual

Legal value string representation.

Implements utility::options::Option.

static BooleanOption utility::options::BooleanOption::NoDefault ( BooleanOptionKey const &  key_a,
std::string const &  description_a 
)
inlinestatic

Key + description no-default named constructor.

References BooleanOption().

std::string utility::options::BooleanOption::type_string ( ) const
inlineoverridevirtual

Option type code string representation.

Implements utility::options::Option.

Value utility::options::BooleanOption::value_of ( std::string const &  value_str) const
inlineoverrideprotectedvirtual
std::string utility::options::BooleanOption::value_string ( ) const
inlineoverridevirtual

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