Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component baltzo_dstpolicy
[Package baltzo]

Enumerate the set of daylight-saving time (DST) policy values. More...

Namespaces

namespace  baltzo

Detailed Description

Outline
Purpose:
Enumerate the set of daylight-saving time (DST) policy values.
Classes:
baltzo::DstPolicy namespace for a daylight-saving time policy enum
See also:
Component baltzo_localtimevalidity, Component baltzo_timezoneutil
Description:
This component provides a namespace for the enum type baltzo::DstPolicy::Enum, which enumerates the set of policies for interpreting whether an associated local time is a daylight-saving time value. A baltzo::DstPolicy is particularly important when interpreting a local time that is not associated with a UTC offset (e.g., a bdlt::Datetime object), as such a representation may be ambiguous or invalid (see baltzo_localtimevalidity).
Enumerators:
  Name            Description
  -------------   ---------------------------------------------------
  e_DST           Local time is interpreted as daylight-saving time.

  e_STANDARD      Local time is interpreted as standard time.

  e_UNSPECIFIED   Local time is interpreted as either daylight-saving time or
                  standard time (as appropriate).
Usage:
This section illustrates intended use of this component.
Example 1: Basic Syntax:
The following snippets of code provide a simple illustration of using baltzo::DstPolicy.
First, we create a variable value of type baltzo::DstPolicy::Enum and initialize it with the enumerator value baltzo::DstPolicy::e_STANDARD:
  baltzo::DstPolicy::Enum value = baltzo::DstPolicy::e_STANDARD;
Now, we store the address of its ASCII representation in a pointer variable, asciiValue, of type const char *:
  const char *asciiValue = baltzo::DstPolicy::toAscii(value);
  assert(0 == bsl::strcmp(asciiValue, "STANDARD"));
Finally, we print value to bsl::cout.
  bsl::cout << value << bsl::endl;
This statement produces the following output on stdout:
  STANDARD