Rosetta
|
Program boolean option class. More...
#include <BooleanOption.hh>
Public Member Functions | |
BooleanOption () | |
Default constructor. More... | |
BooleanOption (BooleanOptionKey const &key_a, std::string const &description_a) | |
Key + description constructor. More... | |
BooleanOption * | clone () const override |
Clone this. More... | |
~BooleanOption () override | |
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... | |
![]() | |
~ScalarOption_T_ () override | |
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... | |
![]() | |
~ScalarOption () override | |
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... | |
![]() | |
virtual | ~Option () |
Destructor. More... | |
Option & | is_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... | |
Option & | restrict_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... | |
![]() | |
static void | print_error_message (std::string const &message) |
Print an error message. As a separate function to keep stream handling from being part of the header files. 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... | |
![]() | |
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... | |
![]() | |
ScalarOption () | |
Default constructor. More... | |
ScalarOption (ScalarOption const &)=default | |
Copy constructor. More... | |
ScalarOption & | operator= (ScalarOption const &) |
Copy assignment. More... | |
![]() | |
Option () | |
Default constructor. More... | |
Option (Option const &option) | |
Copy constructor. More... | |
Option & | operator= (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 | |
![]() | |
typedef BooleanOptionKey | key_type |
typedef bool | value_type |
typedef BooleanOptionKey | Key |
typedef bool | Value |
![]() | |
typedef OptionKey | key_type |
typedef std::size_t | size_type |
typedef OptionKey | Key |
typedef std::size_t | Size |
![]() | |
enum | State { INACTIVE , DEFAULT , USER } |
Option state enumeration. More... | |
Program boolean option class.
|
private |
|
inline |
Default constructor.
Referenced by clone(), and NoDefault().
|
inline |
Key + description constructor.
References utility::options::ScalarOption_T_< BooleanOptionKey, bool >::default_value().
|
inlineoverride |
Destructor.
|
inlineprivate |
Key + description default control constructor.
References utility::options::ScalarOption_T_< BooleanOptionKey, bool >::default_value().
|
inlineoverridevirtual |
Clone this.
Implements utility::options::ScalarOption_T_< BooleanOptionKey, bool >.
References BooleanOption().
|
inlineoverridevirtual |
Default value string representation.
Implements utility::options::Option.
|
inlineoverridevirtual |
=Value string representation
Implements utility::options::Option.
References utility::options::ScalarOption_T_< BooleanOptionKey, bool >::active(), and utility::options::ScalarOption_T_< BooleanOptionKey, bool >::value().
|
inlineoverridevirtual |
Is a string readable as this option's value type and a legal command line value?
Implements utility::options::Option.
References is_value().
|
inlineprotected |
String accepted as a false value?
References utility::is_false_string().
Referenced by is_value(), and value_of().
|
inlineprotected |
String accepted as a true value?
References utility::is_true_string().
Referenced by is_value(), and value_of().
|
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().
|
inlineoverridevirtual |
Legal value string representation.
Implements utility::options::Option.
|
inlinestatic |
Key + description no-default named constructor.
References BooleanOption().
|
inlineoverridevirtual |
Option type code string representation.
Implements utility::options::Option.
|
inlineoverrideprotectedvirtual |
Value of a string.
Implements utility::options::ScalarOption_T_< BooleanOptionKey, bool >.
References utility::options::OptionKeys::options::exit, is_false_value(), is_true_value(), and utility::options::Option::print_error_message().
|
inlineoverridevirtual |
Value string representation.
Implements utility::options::Option.
References utility::options::ScalarOption_T_< BooleanOptionKey, bool >::active(), and utility::options::ScalarOption_T_< BooleanOptionKey, bool >::value().