OpenStudio:utilities
 AllClasses Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages

#include "Date.hpp"

Public Types

typedef boost::gregorian::date ImplType

Public Member Functions

int assumedBaseYear () const
boost::optional< intbaseYear () const
void baseYear (int baseYear)
 Date ()
 Date (const ImplType &impl)
 Date (MonthOfYear monthOfYear, unsigned dayOfMonth)
 Date (MonthOfYear monthOfYear, unsigned dayOfMonth, int year)
 Date (MonthOfYear monthOfYear, unsigned dayOfMonth, const YearDescription &yearDescription)
 Date (const std::string &string)
 Date (tm t_tm)
 Date (const Date &other)
unsigned dayOfMonth () const
DayOfWeek dayOfWeek () const
unsigned dayOfYear () const
bool isLeapYear () const
MonthOfYear monthOfYear () const
bool operator!= (const Date &other) const
Date operator+ (const Time &time) const
Dateoperator+= (const Time &time)
Date operator- (const Time &time) const
Time operator- (const Date &date) const
Dateoperator-= (const Time &time)
bool operator< (const Date &rhs) const
bool operator<= (const Date &rhs) const
Dateoperator= (const Date &other)
bool operator== (const Date &other) const
bool operator> (const Date &rhs) const
bool operator>= (const Date &rhs) const
int year () const
 ~Date ()

Static Public Member Functions

static Date currentDate ()
static Date fromDayOfYear (unsigned dayOfYear)
static Date fromDayOfYear (unsigned dayOfYear, int year)
static Date fromDayOfYear (unsigned dayOfYear, const YearDescription &yearDescription)
static Date fromNthDayOfMonth (NthDayOfWeekInMonth n, DayOfWeek dayOfWeek, MonthOfYear monthOfYear)
static Date fromNthDayOfMonth (NthDayOfWeekInMonth n, DayOfWeek dayOfWeek, MonthOfYear monthOfYear, int year)
static bool isLeapYear (int year)
static openstudio::LogChannel logChannel ()

Friends

std::ostream & operator<< (std::ostream &os, const Date &date)
std::ostream & operator<< (std::ostream &os, const DateTime &dateTime)

Detailed Description

Date is an absolute unit of time, resolution to the day Date is simple wrapper around boost::gregorian::date.

Member Typedef Documentation

typedef boost::gregorian::date openstudio::Date::ImplType

impl type is boost::gregorian::date

Constructor & Destructor Documentation

openstudio::Date::Date ( )

default constructor

openstudio::Date::~Date ( )
inline

destructor

openstudio::Date::Date ( const ImplType impl)

from impl

openstudio::Date::Date ( MonthOfYear  monthOfYear,
unsigned  dayOfMonth 
)

Date from month, day of month.

openstudio::Date::Date ( MonthOfYear  monthOfYear,
unsigned  dayOfMonth,
int  year 
)

Date from month, day of month, year.

openstudio::Date::Date ( MonthOfYear  monthOfYear,
unsigned  dayOfMonth,
const YearDescription yearDescription 
)

Date from YearDescription, month, and day of month.

openstudio::Date::Date ( const std::string &  string)

constructor from string

openstudio::Date::Date ( tm  t_tm)

Date from a system tm structure.

openstudio::Date::Date ( const Date other)

copy constructor

Member Function Documentation

int openstudio::Date::assumedBaseYear ( ) const

assumed base year

boost::optional<int> openstudio::Date::baseYear ( ) const

user provided base year

void openstudio::Date::baseYear ( int  baseYear)

set base year

static Date openstudio::Date::currentDate ( )
static

get current Date

unsigned openstudio::Date::dayOfMonth ( ) const

day of month

DayOfWeek openstudio::Date::dayOfWeek ( ) const

day of the week

unsigned openstudio::Date::dayOfYear ( ) const

day of year

static Date openstudio::Date::fromDayOfYear ( unsigned  dayOfYear)
static

Day of year generators.

static Date openstudio::Date::fromDayOfYear ( unsigned  dayOfYear,
int  year 
)
static
static Date openstudio::Date::fromDayOfYear ( unsigned  dayOfYear,
const YearDescription yearDescription 
)
static
static Date openstudio::Date::fromNthDayOfMonth ( NthDayOfWeekInMonth  n,
DayOfWeek  dayOfWeek,
MonthOfYear  monthOfYear 
)
static

nth weekday of month generators

static Date openstudio::Date::fromNthDayOfMonth ( NthDayOfWeekInMonth  n,
DayOfWeek  dayOfWeek,
MonthOfYear  monthOfYear,
int  year 
)
static
static bool openstudio::Date::isLeapYear ( int  year)
static

is year a leap year

bool openstudio::Date::isLeapYear ( ) const

is assumed year a leap year

static openstudio::LogChannel openstudio::Date::logChannel ( )
inlinestatic
MonthOfYear openstudio::Date::monthOfYear ( ) const

month of year

bool openstudio::Date::operator!= ( const Date other) const

non-equality operator

Date openstudio::Date::operator+ ( const Time time) const

addition operator

Date& openstudio::Date::operator+= ( const Time time)

assignment by addition operator

Date openstudio::Date::operator- ( const Time time) const

difference operator

Time openstudio::Date::operator- ( const Date date) const

time duration

Date& openstudio::Date::operator-= ( const Time time)

assignment by difference operator

bool openstudio::Date::operator< ( const Date rhs) const

less than operator

bool openstudio::Date::operator<= ( const Date rhs) const

less than equals operator

Date& openstudio::Date::operator= ( const Date other)

assignment operator

bool openstudio::Date::operator== ( const Date other) const

equality operator

bool openstudio::Date::operator> ( const Date rhs) const

greater than operator

bool openstudio::Date::operator>= ( const Date rhs) const

greater than equals operator

int openstudio::Date::year ( ) const

year

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Date date 
)
friend
std::ostream& operator<< ( std::ostream &  os,
const DateTime dateTime 
)
friend