BDE 4.14.0 Production release
|
#include <balcl_optiontype.h>
Public Types | |
enum | Enum { e_VOID , e_BOOL , e_CHAR , e_INT , e_INT64 , e_DOUBLE , e_STRING , e_DATETIME , e_DATE , e_TIME , e_CHAR_ARRAY , e_INT_ARRAY , e_INT64_ARRAY , e_DOUBLE_ARRAY , e_STRING_ARRAY , e_DATETIME_ARRAY , e_DATE_ARRAY , e_TIME_ARRAY } |
typedef bool | Bool |
typedef char | Char |
typedef int | Int |
typedef bsls::Types::Int64 | Int64 |
typedef double | Double |
typedef bsl::string | String |
typedef bdlt::Datetime | Datetime |
typedef bdlt::Date | Date |
typedef bdlt::Time | Time |
typedef bsl::vector< char > | CharArray |
typedef bsl::vector< int > | IntArray |
typedef bsl::vector< bsls::Types::Int64 > | Int64Array |
typedef bsl::vector< double > | DoubleArray |
typedef bsl::vector< bsl::string > | StringArray |
typedef bsl::vector< bdlt::Datetime > | DatetimeArray |
typedef bsl::vector< bdlt::Date > | DateArray |
typedef bsl::vector< bdlt::Time > | TimeArray |
Aliases for each of the supported command-line-option types. | |
Static Public Member Functions | |
static Enum | fromArrayType (Enum type) |
static bool | isArrayType (Enum type) |
static Enum | toArrayType (Enum type) |
static bsl::ostream & | print (bsl::ostream &stream, OptionType::Enum value, int level=0, int spacesPerLevel=4) |
static const char * | toAscii (OptionType::Enum value) |
Static Public Attributes | |
static Bool *const | k_BOOL |
static Char *const | k_CHAR |
static Int *const | k_INT |
static Int64 *const | k_INT64 |
static Double *const | k_DOUBLE |
static String *const | k_STRING |
static Datetime *const | k_DATETIME |
static Date *const | k_DATE |
static Time *const | k_TIME |
static CharArray *const | k_CHAR_ARRAY |
static IntArray *const | k_INT_ARRAY |
static Int64Array *const | k_INT64_ARRAY |
static DoubleArray *const | k_DOUBLE_ARRAY |
static StringArray *const | k_STRING_ARRAY |
static DatetimeArray *const | k_DATETIME_ARRAY |
static DateArray *const | k_DATE_ARRAY |
static TimeArray *const | k_TIME_ARRAY |
This struct
provides a namespace for enumerating types used for command-line option values. See {Enumerators} for details.
This struct
:
For terminology see bsldoc_glossary .
typedef bool balcl::OptionType::Bool |
typedef char balcl::OptionType::Char |
typedef bsl::vector<char> balcl::OptionType::CharArray |
typedef bdlt::Date balcl::OptionType::Date |
typedef double balcl::OptionType::Double |
typedef bsl::vector<double> balcl::OptionType::DoubleArray |
typedef int balcl::OptionType::Int |
typedef bsl::vector<int> balcl::OptionType::IntArray |
typedef bsl::string balcl::OptionType::String |
typedef bdlt::Time balcl::OptionType::Time |
|
inlinestatic |
If isArrayType(type)
for the specified type
, then return the type of the elements of that array type
; otherwise return e_VOID
.
|
inlinestatic |
Return true
if the specified type
corresponds to an array type, and false
otherwise.
|
static |
Write the string representation of the specified enumeration value
to the specified output stream
, 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
). See toAscii
for what constitutes the string representation of a OptionType::Enum
value.
|
inlinestatic |
If there is an array type whose elements have the specified type
then return that array type; otherwise return e_VOID
. e_VOID == toArrayType(e_BOOL)
because an array of boolean values is not allowed as a command-line-option type. Note that type == fromArrayType(TYPE)
when TYPE != e_VOID
is returned.
|
static |
Return the (non-modifiable) string representation corresponding to the specified enumeration value
, if it exists, and a unique (error) string otherwise. The string representation of value
matches its corresponding enumerator name with the e_
prefix elided. For example:
will print the following on standard output:
Note that specifying a value
that does not match any of the enumerators will result in a string representation that is distinct from any of those corresponding to the enumerators, but is otherwise unspecified.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Statically initialized null pointers, one for each supported command-line-option type.