option_t Class Reference
[Run-Time Options]

Inherits w_base_t.

Inheritance diagram for option_t:

Inheritance graph
[legend]
Collaboration diagram for option_t:

Collaboration graph
[legend]
List of all members.

Detailed Description

A single run-time option (e.g., from a .rc file). See Run-Time Options.

Information about an option is stored in a option_t object. All options have:

Examples:

create_rec.cpp, log_exceed.cpp, sort_stream.cpp, and vtable_example.cpp.

Definition at line 122 of file option.h.

Public Member Functions

bool match (const char *matchName, bool exact=false)
 Returns true if the option name matches matchName.
w_rc_t set_value (const char *value, bool overRide, ostream *err_stream)
 Set the value of an option if it is not already set or if overRide is true.
const char * value ()
 Get current assigned value.
bool is_set ()
 Has this option been given a non-default value?
bool is_required ()
 Is this option required to be given a non-default value?
const char * name ()
 Return the string name of the option.
const char * possible_values ()
 Return a string of the permissible values, for printing usage info.
const char * default_value ()
 Return a string of the default value.
const char * description ()
 Return a string describing the meaning of the option.
w_rc_t copyValue (const char *value)
w_rc_t concatValue (const char *value)

Static Public Member Functions

static w_rc_t set_value_bool (option_t *opt, const char *value, ostream *err_stream)
static w_rc_t set_value_int4 (option_t *opt, const char *value, ostream *err_stream)
static w_rc_t set_value_int8 (option_t *opt, const char *value, ostream *err_stream)
static w_rc_t set_value_charstr (option_t *opt, const char *value, ostream *err_stream)
static w_rc_t set_value_long (option_t *opt, const char *value, ostream *err_stream)
static w_rc_t set_value_long_long (option_t *opt, const char *value, ostream *err_stream)
static bool str_to_bool (const char *str, bool &bad_str)


Member Function Documentation

w_rc_t option_t::set_value ( const char *  value,
bool  overRide,
ostream *  err_stream 
)

Set the value of an option if it is not already set or if overRide is true.

Error messages will be "printed" to err_stream if the given pointer to err_stream is non-null.

A value of NULL indicates "please un-set the value".

Definition at line 154 of file option.cpp.

References DBG, name(), RCOK, and W_DO.

Referenced by option_group_t::parse_command_line(), option_stream_scan_t::scan(), and option_group_t::set_value().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Jul 7 17:22:43 2010 for Shore Storage Manager by  doxygen 1.4.7