Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bdlt_dayofweekutil
[Package bdlt]

Provide common non-primitive operations on bdlt::DayOfWeek::Enum. More...

Namespaces

namespace  bdlt

Detailed Description

Outline
Purpose:
Provide common non-primitive operations on bdlt::DayOfWeek::Enum.
Classes:
bdlt::DayOfWeekUtil functions operating on the day-of-week enumeration
See also:
Component bdlt_dayofweek
Description:
This utility component provides a struct, bdlt::DayOfWeekUtil, that serves as a namespace for functions operating on the day-of-week enumeration.
This component provides the following (static) methods:
  'add'                      Determine the day of the week that results from
                             shifting a given 'bdlt::DayOfWeek::Enum' value
                             by a given (signed) number of days.
Usage:
This section illustrates intended use of this component.
Example 1: Basic Usage:
Suppose we have some event occurring every ten days. Today is the day of the performance, assumed to be a Friday, and we want to know when the previous one took place and when the next one will be.
First, we create a bdlt::DayOfWeek variable for the current day:
  bdlt::DayOfWeek::Enum current = bdlt::DayOfWeek::e_FRI;
Next, we calculate previous and following event days using the bdlt::DayOfWeekUtil::add function: Finally, we verify the resultant day-of-week values:
  assert(bdlt::DayOfWeek::e_TUE == previous );
  assert(bdlt::DayOfWeek::e_MON == following);