This class implements a special-use value-semantic variant type used to represent values parsed from process command lines. Accordingly, this class can represent values of any of the types defined in balcl_optiontype . Furthermore, that value can also be in a null state (defined type but no defined value) to represent allowed options that do not appear among the command-line arguments (and for which no default value has been configured).
See balcl_optionvalue
|
| | BSLMF_NESTED_TRAIT_DECLARATION (OptionValue, bslma::UsesBslmaAllocator) |
| |
| | BSLMF_NESTED_TRAIT_DECLARATION (OptionValue, bdlb::HasPrintMethod) |
| |
| | OptionValue () |
| |
| | OptionValue (bslma::Allocator *basicAllocator) |
| |
| | OptionValue (OptionType::Enum type, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (bool value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (char value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (int value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (bsls::Types::Int64 value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (double value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::string &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (bdlt::Datetime value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (bdlt::Date value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (bdlt::Time value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< char > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< int > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< bsls::Types::Int64 > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< double > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< bsl::string > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< bdlt::Datetime > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< bdlt::Date > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const bsl::vector< bdlt::Time > &value, bslma::Allocator *basicAllocator=0) |
| |
| | OptionValue (const OptionValue &original, bslma::Allocator *basicAllocator=0) |
| |
| | ~OptionValue ()=default |
| |
| OptionValue & | operator= (const OptionValue &rhs) |
| |
| void | reset () |
| |
| template<class TYPE > |
| void | set (const TYPE &value) |
| |
| void | setNull () |
| |
| void | setType (OptionType::Enum type) |
| |
| template<class TYPE > |
| TYPE & | the () |
| |
| void | swap (OptionValue &other) |
| |
| bool | hasNonVoidType () const |
| |
| bool | isNull () const |
| |
| template<class TYPE > |
| const TYPE & | the () const |
| |
| OptionType::Enum | type () const |
| |
| bslma::Allocator * | allocator () const |
| |
| bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
| |
| bsl::ostream & balcl::OptionValue::print |
( |
bsl::ostream & |
stream, |
|
|
int |
level = 0, |
|
|
int |
spacesPerLevel = 4 |
|
) |
| const |
Write the value of this object to the specified output stream in a human-readable format, and return a reference to stream. Optionally specify an initial indentation level, whose absolute value is incremented recursively for nested objects. If level is specified, optionally specify spacesPerLevel, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.
- Note
- Note that the format is not fully specified, and can change without notice.