Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component baltzo_errorcode
[Package baltzo]

Enumerate the set of named errors for the baltzo package. More...

Namespaces

namespace  baltzo

Detailed Description

Outline
Purpose:
Enumerate the set of named errors for the baltzo package.
Classes:
baltzo::ErrorCode namespace for error status enum
See also:
Component baltzo_localtimedescriptor, Component baltzo_timezoneutil
Description:
This component provides a namespace, baltzo::ErrorCode, for the enum type baltzo::ErrorCode::Enum, which enumerates the set of named error codes returned by functions across the baltzo package.
Enumerators:
  Name               Description
  ----------------   --------------------------------------
  k_UNSUPPORTED_ID   Time zone identifier is not supported.

  k_OUT_OF_RANGE     A conversion would have resulted in a value outside of
                     the valid range
Usage:
This section illustrates intended use of this component.
Example 1: Basic Syntax:
The following snippets of code provide a simple illustration of baltzo::ErrorCode usage.
First, we create a variable value of type baltzo::ErrorCode::Enum and initialize it with the enumerator value baltzo::ErrorCode::k_UNSUPPORTED_ID:
  baltzo::ErrorCode::Enum value = baltzo::ErrorCode::k_UNSUPPORTED_ID;
Now, we store a pointer to its ASCII representation in a variable asciiValue of type const char *:
  const char *asciiValue = baltzo::ErrorCode::toAscii(value);
  assert(0 == bsl::strcmp(asciiValue, "UNSUPPORTED_ID"));
Finally, we print value to bsl::cout.
  bsl::cout << value << bsl::endl;
This statement produces the following output on stdout:
  UNSUPPORTED_ID