Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Static Public Member Functions

bdlt::PackedCalendar_DateRef Class Reference

#include <bdlt_packedcalendar.h>

Inheritance diagram for bdlt::PackedCalendar_DateRef:
bdlt::Date

List of all members.

Public Member Functions

 PackedCalendar_DateRef (const Date &date)
 PackedCalendar_DateRef (const PackedCalendar_DateRef &original)
 ~PackedCalendar_DateRef ()
PackedCalendar_DateProxy operator& () const
Dateoperator+= (int numDays)
Dateoperator-= (int numDays)
Dateoperator++ ()
Dateoperator-- ()
int addDaysIfValid (int numDays)
void setYearDay (int year, int dayOfYear)
int setYearDayIfValid (int year, int dayOfYear)
void setYearMonthDay (int year, int month, int day)
int setYearMonthDayIfValid (int year, int month, int day)
template<class STREAM >
STREAM & bdexStreamIn (STREAM &stream, int version)
int day () const
DayOfWeek::Enum dayOfWeek () const
int dayOfYear () const
void getYearDay (int *year, int *dayOfYear) const
void getYearMonthDay (int *year, int *month, int *day) const
int month () const
MonthOfYear::Enum monthOfYear () const
int year () const
template<class STREAM >
STREAM & bdexStreamOut (STREAM &stream, int version) const
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bsl::ostream & streamOut (bsl::ostream &stream) const
int validateAndSetYearDay (int year, int dayOfYear)
int validateAndSetYearMonthDay (int year, int month, int day)

Static Public Member Functions

static bool isValidYearDay (int year, int dayOfYear)
static bool isValidYearMonthDay (int year, int month, int day)
static int maxSupportedBdexVersion (int versionSelector)
static int maxSupportedBdexVersion ()
static bool isValid (int year, int dayOfYear)
static bool isValid (int year, int month, int day)
static int maxSupportedVersion ()

Detailed Description

This private class is used by the arrow operator of the holiday iterator and business day iterator classes. The objects instantiated from this class serve as references to Date objects.

See Component bdlt_packedcalendar


Constructor & Destructor Documentation

bdlt::PackedCalendar_DateRef::PackedCalendar_DateRef ( const Date date  )  [explicit]

Create a date reference object using the specified date.

bdlt::PackedCalendar_DateRef::PackedCalendar_DateRef ( const PackedCalendar_DateRef original  ) 

Create a date reference object having the value of the specified original object.

bdlt::PackedCalendar_DateRef::~PackedCalendar_DateRef (  ) 

Destroy this object.


Member Function Documentation

PackedCalendar_DateProxy bdlt::PackedCalendar_DateRef::operator& (  )  const

Return a proxy object to this object's referenced date.

static bool bdlt::Date::isValidYearDay ( int  year,
int  dayOfYear 
) [static, inherited]

Return true if the specified year and dayOfYear represent a valid value for a Date object, and false otherwise. year and dayOfYear represent a valid Date value if they correspond to a valid date as defined by the Unix (POSIX) calendar confined to the year range [1 .. 9999] inclusive. See Valid Date Values and Their Representations for details.

static bool bdlt::Date::isValidYearMonthDay ( int  year,
int  month,
int  day 
) [static, inherited]

Return true if the specified year, month, and day represent a valid value for a Date object, and false otherwise. year, month, and day represent a valid Date value if they correspond to a valid date as defined by the Unix (POSIX) calendar confined to the year range [1 .. 9999] inclusive. See Valid Date Values and Their Representations for details.

static int bdlt::Date::maxSupportedBdexVersion ( int  versionSelector  )  [static, inherited]

Return the maximum valid BDEX format version, as indicated by the specified versionSelector, to be passed to the bdexStreamOut method. Note that it is highly recommended that versionSelector be formatted as "YYYYMMDD", a date representation. Also note that versionSelector should be a compile-time-chosen value that selects a format version supported by both externalizer and unexternalizer. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

static int bdlt::Date::maxSupportedBdexVersion (  )  [static, inherited]

DEPRECATED: Use maxSupportedBdexVersion(int) instead.

Return the most current BDEX streaming version number supported by this class.

Date& bdlt::Date::operator+= ( int  numDays  )  [inherited]

Assign to this object the value that is later by the specified (signed) numDays from its current value, and return a reference providing modifiable access to this object. The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see isValidYearMonthDay). Note that numDays may be negative.

Date& bdlt::Date::operator-= ( int  numDays  )  [inherited]

Assign to this object the value that is earlier by the specified (signed) numDays from its current value, and return a reference providing modifiable access to this object. The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see isValidYearMonthDay). Note that numDays may be negative.

Date& bdlt::Date::operator++ (  )  [inherited]

Set this object to have the value that is one day later than its current value, and return a reference providing modifiable access to this object. The behavior is undefined if the year/month/day representation of the current value is 9999/12/31.

Date& bdlt::Date::operator-- (  )  [inherited]

Set this object to have the value that is one day earlier than its current value, and return a reference providing modifiable access to this object. The behavior is undefined if the year/month/day representation of the current value is 0001/01/01.

int bdlt::Date::addDaysIfValid ( int  numDays  )  [inherited]

Set this object to have the value that is later by the specified (signed) numDays from its current value, if the resulting value falls within the range of dates supported by this class (see isValidYearMonthDay). Return 0 on success, and a non-zero value (with no effect) otherwise. Note that numDays may be negative.

void bdlt::Date::setYearDay ( int  year,
int  dayOfYear 
) [inherited]

Set this object to have the value represented by the specified year and dayOfYear. The behavior is undefined unless year and dayOfYear represent a valid Date value (see isValidYearDay).

int bdlt::Date::setYearDayIfValid ( int  year,
int  dayOfYear 
) [inherited]

Set this object to have the value represented by the specified year and dayOfYear if they comprise a valid Date value (see isValidYearDay). Return 0 on success, and a non-zero value (with no effect) otherwise.

void bdlt::Date::setYearMonthDay ( int  year,
int  month,
int  day 
) [inherited]

Set this object to have the value represented by the specified year, month, and day. The behavior is undefined unless year, month, and day represent a valid Date value (see isValidYearMonthDay).

int bdlt::Date::setYearMonthDayIfValid ( int  year,
int  month,
int  day 
) [inherited]

Set this object to have the value represented by the specified year, month, and day if they comprise a valid Date value (see isValidYearMonthDay). Return 0 on success, and a non-zero value (with no effect) otherwise.

template<class STREAM >
STREAM& bdlt::Date::bdexStreamIn ( STREAM &  stream,
int  version 
) [inherited]

Assign to this object the value read from the specified input stream using the specified version format, and return a reference to stream. If stream is initially invalid, this operation has no effect. If version is not supported, this object is unaltered and stream is invalidated, but otherwise unmodified. If version is supported but stream becomes invalid during this operation, this object has an undefined, but valid, state. Note that no version is read from stream. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

int bdlt::Date::day (  )  const [inherited]

Return the day of the month in the range [1 .. 31] of this date.

DayOfWeek::Enum bdlt::Date::dayOfWeek (  )  const [inherited]

Return the day of the week in the range [DayOfWeek::e_SUN .. DayOfWeek::e_SAT] of this date.

int bdlt::Date::dayOfYear (  )  const [inherited]

Return the day of the year in the range [1 .. 366] of this date.

void bdlt::Date::getYearDay ( int *  year,
int *  dayOfYear 
) const [inherited]

Load, into the specified year and dayOfYear, the respective year and dayOfYear attribute values of this date.

void bdlt::Date::getYearMonthDay ( int *  year,
int *  month,
int *  day 
) const [inherited]

Load, into the specified year, month, and day, the respective year, month, and day attribute values of this date.

int bdlt::Date::month (  )  const [inherited]

Return the month of the year in the range [1 .. 12] of this date.

MonthOfYear::Enum bdlt::Date::monthOfYear (  )  const [inherited]

Return the month of the year in the range [MonthOfYear::e_JAN .. MonthOfYear::e_DEC] of this date.

int bdlt::Date::year (  )  const [inherited]

Return the year in the range [1 .. 9999] of this date.

template<class STREAM >
STREAM& bdlt::Date::bdexStreamOut ( STREAM &  stream,
int  version 
) const [inherited]

Write the value of this object, using the specified version format, to the specified output stream, and return a reference to stream. If stream is initially invalid, this operation has no effect. If version is not supported, stream is invalidated, but otherwise unmodified. Note that version is not written to stream. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

bsl::ostream& bdlt::Date::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const [inherited]

Write the value of this object to the specified output stream in a human-readable format, and return a reference to stream. Optionally specify an initial indentation level, whose absolute value is incremented recursively for nested objects. If level is specified, optionally specify spacesPerLevel, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. Note that this human-readable format is not fully specified, and can change without notice.

static bool bdlt::Date::isValid ( int  year,
int  dayOfYear 
) [static, inherited]

DEPRECATED: Use isValidYearDay instead.

Return true if the specified year and dayOfYear represent a valid value for a Date object, and false otherwise. year and dayOfYear represent a valid Date value if they correspond to a valid date as defined by the Unix (POSIX) calendar confined to the year range [1 .. 9999] inclusive. See Valid Date Values and Their Representations for details.

static bool bdlt::Date::isValid ( int  year,
int  month,
int  day 
) [static, inherited]

DEPRECATED: Use isValidYearMonthDay instead.

Return true if the specified year, month, and day represent a valid value for a Date object, and false otherwise. year, month, and day represent a valid Date value if they correspond to a valid date as defined by the Unix (POSIX) calendar confined to the year range [1 .. 9999] inclusive. See Valid Date Values and Their Representations for details.

static int bdlt::Date::maxSupportedVersion (  )  [static, inherited]

DEPRECATED: Use maxSupportedBdexVersion(int) instead.

Return the most current BDEX streaming version number supported by this class.

bsl::ostream& bdlt::Date::streamOut ( bsl::ostream &  stream  )  const [inherited]

DEPRECATED: Use print instead.

Write the value of this object to the specified output stream in a single-line format, and return a reference to stream. If stream is not valid on entry, this operation has no effect. Note that this human-readable format is not fully specified, can change without notice, and is logically equivalent to:

          print(stream, 0, -1);
int bdlt::Date::validateAndSetYearDay ( int  year,
int  dayOfYear 
) [inherited]

DEPRECATED: Use setYearDayIfValid instead.

Set this object to have the value represented by the specified year and dayOfYear if they comprise a valid Date value (see isValidYearDay). Return 0 on success, and a non-zero value (with no effect) otherwise.

int bdlt::Date::validateAndSetYearMonthDay ( int  year,
int  month,
int  day 
) [inherited]

DEPRECATED: Use setYearMonthDayIfValid instead.

Set this object to have the value represented by the specified year, month, and day if they comprise a valid Date value (see isValidYearMonthDay). Return 0 on success, and a non-zero value (with no effect) otherwise.


The documentation for this class was generated from the following file: