[#BloombergLP-balcl-OptionType] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::OptionType :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for enumerating types used for command‐line option values. See {Enumerators} for details. == Synopsis Declared in `<balcl_optiontype.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct OptionType; ---- == Description This `struct`: * Supports a complete set of _enumeration_ operations. * Provides several additional utility functions. For terminology see `bsldoc_glossary`. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OptionType/EnumToType-0f.adoc[`EnumToType`] | `EnumToType<TYPE_ENUMERATOR>::type` is the (C++) type corresponding to the (template parameter) `TYPE_ENUMERATOR` `Enum` value. See `TypeToEnum` for the inverse metafunction. | xref:BloombergLP/balcl/OptionType/TypeToEnum-06.adoc[`TypeToEnum`] | `TypeToEnum<TYPE>::value` is the `Enum` value corresponding to the (template parameter) `TYPE` where `TYPE` matches one of the `typedef`s defined above or `void`. See `EnumToType` for the inverse metafunction. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OptionType/Bool.adoc[`Bool`] | Alias for the `bool` command‐line option value type. | xref:BloombergLP/balcl/OptionType/Char.adoc[`Char`] | Alias for the `char` command‐line option value type. | xref:BloombergLP/balcl/OptionType/CharArray.adoc[`CharArray`] | Alias for an array of `char` command‐line option values. | xref:BloombergLP/balcl/OptionType/Date.adoc[`Date`] | Alias for the `Date` command‐line option value type. | xref:BloombergLP/balcl/OptionType/DateArray.adoc[`DateArray`] | Alias for an array of `Date` command‐line option values. | xref:BloombergLP/balcl/OptionType/Datetime.adoc[`Datetime`] | Alias for the `Datetime` command‐line option value type. | xref:BloombergLP/balcl/OptionType/DatetimeArray.adoc[`DatetimeArray`] | Alias for an array of `Datetime` command‐line option values. | xref:BloombergLP/balcl/OptionType/Double.adoc[`Double`] | Alias for the `double` command‐line option value type. | xref:BloombergLP/balcl/OptionType/DoubleArray.adoc[`DoubleArray`] | Alias for an array of `double` command‐line option values. | xref:BloombergLP/balcl/OptionType/Int.adoc[`Int`] | Alias for the `int` command‐line option value type. | xref:BloombergLP/balcl/OptionType/Int64.adoc[`Int64`] | Alias for the `Int64` command‐line option value type. | xref:BloombergLP/balcl/OptionType/Int64Array.adoc[`Int64Array`] | Alias for an array of `Int64` command‐line option values. | xref:BloombergLP/balcl/OptionType/IntArray.adoc[`IntArray`] | Alias for an array of `int` command‐line option values. | xref:BloombergLP/balcl/OptionType/String.adoc[`String`] | Alias for the `string` command‐line option value type. | xref:BloombergLP/balcl/OptionType/StringArray.adoc[`StringArray`] | Alias for an array of `string` command‐line option values. | xref:BloombergLP/balcl/OptionType/Time.adoc[`Time`] | Alias for the `Time` command‐line option value type. | xref:BloombergLP/balcl/OptionType/TimeArray.adoc[`TimeArray`] | Alias for an array of `Time` command‐line option values. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OptionType/Enum.adoc[`Enum`] | Enumerates the supported command‐line option value types. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OptionType/fromArrayType.adoc[`fromArrayType`] | If `isArrayType(type)` for the specified `type`, then return the type of the elements of that array `type`; otherwise return `e_VOID`. | xref:BloombergLP/balcl/OptionType/isArrayType.adoc[`isArrayType`] | Return `true` if the specified `type` corresponds to an array type, and `false` otherwise. | xref:BloombergLP/balcl/OptionType/print.adoc[`print`] | 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. | xref:BloombergLP/balcl/OptionType/toArrayType.adoc[`toArrayType`] | 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. | xref:BloombergLP/balcl/OptionType/toAscii.adoc[`toAscii`] | 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: ` bsl::cout << balcl::OptionType::toAscii( OptionType::e_STRING); ` will print the following on standard output: ` STRING ` 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 Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balcl/OptionType/k_BOOL.adoc[`k_BOOL`] | Null pointer tag for the `Bool` option type. | xref:BloombergLP/balcl/OptionType/k_CHAR.adoc[`k_CHAR`] | Null pointer tag for the `Char` option type. | xref:BloombergLP/balcl/OptionType/k_CHAR_ARRAY.adoc[`k_CHAR_ARRAY`] | Null pointer tag for the `CharArray` option type. | xref:BloombergLP/balcl/OptionType/k_DATE.adoc[`k_DATE`] | Null pointer tag for the `Date` option type. | xref:BloombergLP/balcl/OptionType/k_DATETIME.adoc[`k_DATETIME`] | Null pointer tag for the `Datetime` option type. | xref:BloombergLP/balcl/OptionType/k_DATETIME_ARRAY.adoc[`k_DATETIME_ARRAY`] | Null pointer tag for the `DatetimeArray` option type. | xref:BloombergLP/balcl/OptionType/k_DATE_ARRAY.adoc[`k_DATE_ARRAY`] | Null pointer tag for the `DateArray` option type. | xref:BloombergLP/balcl/OptionType/k_DOUBLE.adoc[`k_DOUBLE`] | Null pointer tag for the `Double` option type. | xref:BloombergLP/balcl/OptionType/k_DOUBLE_ARRAY.adoc[`k_DOUBLE_ARRAY`] | Null pointer tag for the `DoubleArray` option type. | xref:BloombergLP/balcl/OptionType/k_INT.adoc[`k_INT`] | Null pointer tag for the `Int` option type. | xref:BloombergLP/balcl/OptionType/k_INT64.adoc[`k_INT64`] | Null pointer tag for the `Int64` option type. | xref:BloombergLP/balcl/OptionType/k_INT64_ARRAY.adoc[`k_INT64_ARRAY`] | Null pointer tag for the `Int64Array` option type. | xref:BloombergLP/balcl/OptionType/k_INT_ARRAY.adoc[`k_INT_ARRAY`] | Null pointer tag for the `IntArray` option type. | xref:BloombergLP/balcl/OptionType/k_STRING.adoc[`k_STRING`] | Null pointer tag for the `String` option type. | xref:BloombergLP/balcl/OptionType/k_STRING_ARRAY.adoc[`k_STRING_ARRAY`] | Null pointer tag for the `StringArray` option type. | xref:BloombergLP/balcl/OptionType/k_TIME.adoc[`k_TIME`] | Null pointer tag for the `Time` option type. | xref:BloombergLP/balcl/OptionType/k_TIME_ARRAY.adoc[`k_TIME_ARRAY`] | Null pointer tag for the `TimeArray` option type. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#