BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balcl::OptionType Struct Reference

#include <balcl_optiontype.h>

Classes

struct  EnumToType
 
struct  EnumToType< OptionType::e_BOOL >
 
struct  EnumToType< OptionType::e_CHAR >
 
struct  EnumToType< OptionType::e_CHAR_ARRAY >
 
struct  EnumToType< OptionType::e_DATE >
 
struct  EnumToType< OptionType::e_DATE_ARRAY >
 
struct  EnumToType< OptionType::e_DATETIME >
 
struct  EnumToType< OptionType::e_DATETIME_ARRAY >
 
struct  EnumToType< OptionType::e_DOUBLE >
 
struct  EnumToType< OptionType::e_DOUBLE_ARRAY >
 
struct  EnumToType< OptionType::e_INT >
 
struct  EnumToType< OptionType::e_INT64 >
 
struct  EnumToType< OptionType::e_INT64_ARRAY >
 
struct  EnumToType< OptionType::e_INT_ARRAY >
 
struct  EnumToType< OptionType::e_STRING >
 
struct  EnumToType< OptionType::e_STRING_ARRAY >
 
struct  EnumToType< OptionType::e_TIME >
 
struct  EnumToType< OptionType::e_TIME_ARRAY >
 
struct  EnumToType< OptionType::e_VOID >
 
struct  TypeToEnum
 
struct  TypeToEnum< OptionType::Bool >
 
struct  TypeToEnum< OptionType::Char >
 
struct  TypeToEnum< OptionType::CharArray >
 
struct  TypeToEnum< OptionType::Date >
 
struct  TypeToEnum< OptionType::DateArray >
 
struct  TypeToEnum< OptionType::Datetime >
 
struct  TypeToEnum< OptionType::DatetimeArray >
 
struct  TypeToEnum< OptionType::Double >
 
struct  TypeToEnum< OptionType::DoubleArray >
 
struct  TypeToEnum< OptionType::Int >
 
struct  TypeToEnum< OptionType::Int64 >
 
struct  TypeToEnum< OptionType::Int64Array >
 
struct  TypeToEnum< OptionType::IntArray >
 
struct  TypeToEnum< OptionType::String >
 
struct  TypeToEnum< OptionType::StringArray >
 
struct  TypeToEnum< OptionType::Time >
 
struct  TypeToEnum< OptionType::TimeArray >
 
struct  TypeToEnum< void >
 

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::Int64Int64Array
 
typedef bsl::vector< double > DoubleArray
 
typedef bsl::vector< bsl::stringStringArray
 
typedef bsl::vector< bdlt::DatetimeDatetimeArray
 
typedef bsl::vector< bdlt::DateDateArray
 
typedef bsl::vector< bdlt::TimeTimeArray
 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
 

Detailed Description

This struct provides a namespace for enumerating types used for command-line option values. See {Enumerators} for details.

This struct:

  • Supports a complete set of enumeration operations.
  • Provides several additional utility functions.

For terminology see bsldoc_glossary .

Member Typedef Documentation

◆ Bool

◆ Char

◆ CharArray

◆ Date

◆ DateArray

◆ Datetime

◆ DatetimeArray

◆ Double

typedef double balcl::OptionType::Double

◆ DoubleArray

◆ Int

◆ Int64

◆ Int64Array

◆ IntArray

◆ String

◆ StringArray

◆ Time

◆ TimeArray

Member Enumeration Documentation

◆ Enum

Enumerator
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 

Member Function Documentation

◆ fromArrayType()

OptionType::Enum balcl::OptionType::fromArrayType ( OptionType::Enum  type)
inlinestatic

If isArrayType(type) for the specified type, then return the type of the elements of that array type; otherwise return e_VOID.

◆ isArrayType()

bool balcl::OptionType::isArrayType ( OptionType::Enum  type)
inlinestatic

Return true if the specified type corresponds to an array type, and false otherwise.

◆ print()

static bsl::ostream & balcl::OptionType::print ( bsl::ostream &  stream,
OptionType::Enum  value,
int  level = 0,
int  spacesPerLevel = 4 
)
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.

◆ toArrayType()

OptionType::Enum balcl::OptionType::toArrayType ( OptionType::Enum  type)
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.

◆ toAscii()

static const char * balcl::OptionType::toAscii ( OptionType::Enum  value)
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:

static const char * toAscii(OptionType::Enum value)
@ e_STRING
Definition balcl_optiontype.h:256

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.

Member Data Documentation

◆ k_BOOL

Bool* const balcl::OptionType::k_BOOL
static

◆ k_CHAR

Char* const balcl::OptionType::k_CHAR
static

◆ k_CHAR_ARRAY

CharArray* const balcl::OptionType::k_CHAR_ARRAY
static

◆ k_DATE

Date* const balcl::OptionType::k_DATE
static

◆ k_DATE_ARRAY

DateArray* const balcl::OptionType::k_DATE_ARRAY
static

◆ k_DATETIME

Datetime* const balcl::OptionType::k_DATETIME
static

◆ k_DATETIME_ARRAY

DatetimeArray* const balcl::OptionType::k_DATETIME_ARRAY
static

◆ k_DOUBLE

Double* const balcl::OptionType::k_DOUBLE
static

◆ k_DOUBLE_ARRAY

DoubleArray* const balcl::OptionType::k_DOUBLE_ARRAY
static

◆ k_INT

Int* const balcl::OptionType::k_INT
static

◆ k_INT64

Int64* const balcl::OptionType::k_INT64
static

◆ k_INT64_ARRAY

Int64Array* const balcl::OptionType::k_INT64_ARRAY
static

◆ k_INT_ARRAY

IntArray* const balcl::OptionType::k_INT_ARRAY
static

◆ k_STRING

String* const balcl::OptionType::k_STRING
static

◆ k_STRING_ARRAY

StringArray* const balcl::OptionType::k_STRING_ARRAY
static

◆ k_TIME

Time* const balcl::OptionType::k_TIME
static

◆ k_TIME_ARRAY

TimeArray* const balcl::OptionType::k_TIME_ARRAY
static

Statically initialized null pointers, one for each supported command-line-option type.


The documentation for this struct was generated from the following file: