Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bdlt_monthofyear
[Package bdlt]

Enumerate the set of month-of-year values. More...

Namespaces

namespace  bdlt

Detailed Description

Outline
Purpose:
Enumerate the set of month-of-year values.
Classes:
bdlt::MonthOfYear namespace for month-of-year enum
Description:
This component provides a namespace for the enum type, bdlt::MonthOfYear::Enum, that enumerates the set of month-of-year values.
Enumerators:
  Name                           Description
  -------------------            ----------------------------------
  e_JANUARY,   e_JAN             Enumerators representing January
  e_FEBRUARY,  e_FEB             Enumerators representing February
  e_MARCH,     e_MAR             Enumerators representing March
  e_APRIL,     e_APR             Enumerators representing April
  e_MAY                          Enumerator  representing May
  e_JUNE,      e_JUN             Enumerators representing June
  e_JULY,      e_JUL             Enumerators representing July
  e_AUGUST,    e_AUG             Enumerators representing August
  e_SEPTEMBER, e_SEP             Enumerators representing September
  e_OCTOBER,   e_OCT             Enumerators representing October
  e_NOVEMBER,  e_NOV             Enumerators representing November
  e_DECEMBER,  e_DEC             Enumerators representing December

  k_NUM_MONTHS                   Number of enumerators in the range
                                 '[ e_JAN .. e_DEC ]'.
Usage:
This section illustrates intended use of this component.
Example 1: Basic Syntax:
The following snippets of code provide a simple illustration of bdlt::MonthOfYear usage.
First, we create a variable value of type bdlt::MonthOfYear::Enum and initialize it to the value bdlt::MonthOfYear::e_APRIL:
  bdlt::MonthOfYear::Enum value = bdlt::MonthOfYear::e_APRIL;
Next, we store a pointer to its ASCII representation in a variable asciiValue of type const char *:
  const char *asciiValue = bdlt::MonthOfYear::toAscii(value);
  assert(0 == bsl::strcmp(asciiValue, "APR"));
Finally, we print the value to bsl::cout:
  bsl::cout << value << bsl::endl;
This statement produces the following output on stdout:
  APR