BDE 4.14.0 Production release
Loading...
Searching...
No Matches
ball_userfieldtype

Detailed Description

Outline

Purpose

Enumerate the set of data types for a user supplied attribute.

Classes

Description

This component provides a namespace for the enum type, ball::UserFieldType, that enumerates the set of types a user defined log attribute may have.

Enumerators

Name Description
------------ -------------------------------------------------
e_VOID Enumerator representing an unset value
e_INT64 Enumerator representing an integral value
e_DOUBLE Enumerator representing an double value
e_STRING Enumerator representing a string value
e_DATETIMETZ Enumerator representing a DatetimeTz value
e_CHAR_ARRAY Enumerator representing a bsl::vector<char> value
Definition bslstl_vector.h:1025

Usage

This section illustrates intended use of this component.

Example 1: Basic Syntax

The following snippets of code provide a simple illustration of ball::UserFieldType usage.

First, we create a variable value of type ball::UserFieldType::Enum and initialize it to the value ball::UserFieldType::e_STRING:

Enum
Definition ball_userfieldtype.h:123
@ e_STRING
Definition ball_userfieldtype.h:128

Next, we store a pointer to its ASCII representation in a variable asciiValue of type const char *:

const char *asciiValue = ball::UserFieldType::toAscii(value);
assert(0 == bsl::strcmp(asciiValue, "STRING"));
static const char * toAscii(UserFieldType::Enum value)

Finally, we print the value to bsl::cout:

bsl::cout << value << bsl::endl;

This statement produces the following output on stdout:

STRING