Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Date Class Reference

Date stores date and time in a 'struct tm'. More...

#include <Date.h>

Collaboration diagram for Date:

Collaboration graph
[legend]
List of all members.

Public Methods

 Date ()
 Date (int day_, int month_, int year_)
 Date (const std::tm &date_)
 Date (const Date &other)
Date & operator= (const Date &other)
virtual ~Date ()
bool is_valid () const
const std::tm & get_Date () const
int is_Feiertag () const
void inc (int offset=1)
void dec (int offset=1)
int year () const
int month () const
int day () const
int dayOfWeek () const

Private Methods

void init (const std::time_t &time_)
void init (const std::tm &date_)
void init (int day, int month, int year)
void correct ()

Private Attributes

std::time_t time
std::tm date
bool valid

Detailed Description

Date stores date and time in a 'struct tm'.

Definition at line 38 of file Date.h.


Constructor & Destructor Documentation

Date   [inline]
 

create the current Date

Definition at line 52 of file Date.h.

Date int    day_,
int    month_,
int    year_
[inline]
 

create a new date (clock is set to 00:00.00 )

Definition at line 55 of file Date.h.

Date const std::tm &    date_ [inline]
 

create a new date from struct tm

Definition at line 58 of file Date.h.

Date const Date &    other [inline]
 

create a new date from another date

Definition at line 61 of file Date.h.

virtual ~Date   [inline, virtual]
 

Definition at line 77 of file Date.h.


Member Function Documentation

void init const std::time_t &    time_ [private]
 

Definition at line 44 of file Date.cpp.

Referenced by Date::correct(), and Date::init().

void init const std::tm &    date_ [private]
 

Definition at line 57 of file Date.cpp.

void init int    day,
int    month,
int    year
[private]
 

Definition at line 83 of file Date.cpp.

void correct   [private]
 

Definition at line 74 of file Date.cpp.

Date& operator= const Date &    other [inline]
 

assign a Date

Definition at line 68 of file Date.h.

bool is_valid   const [inline]
 

returns true if the Date is a valid Date

Definition at line 80 of file Date.h.

const std::tm& get_Date   const [inline]
 

returns date as 'struct tm'

Definition at line 83 of file Date.h.

int is_Feiertag   const
 

returns zero if date is no 'Feiertag' (= german holiday), index otherwise

Definition at line 255 of file Date.cpp.

void inc int    offset = 1 [inline]
 

increment date

Parameters:
offset  days to increment

Definition at line 91 of file Date.h.

void dec int    offset = 1 [inline]
 

decrement date

Parameters:
offset  days to decrement

Definition at line 95 of file Date.h.

int year   const [inline]
 

returns year

Definition at line 98 of file Date.h.

Referenced by Date::is_Feiertag().

int month   const [inline]
 

returns month

Definition at line 100 of file Date.h.

int day   const [inline]
 

returns day of month

Definition at line 102 of file Date.h.

int dayOfWeek   const [inline]
 

returns day of week (0 for sunday)

Definition at line 105 of file Date.h.


Member Data Documentation

std::time_t time [private]
 

Definition at line 40 of file Date.h.

Referenced by Date::Date(), Date::init(), and Date::operator=().

std::tm date [private]
 

Definition at line 41 of file Date.h.

Referenced by Date::correct(), Date::Date(), Date::init(), and Date::operator=().

bool valid [private]
 

Definition at line 42 of file Date.h.

Referenced by Date::Date(), Date::init(), and Date::operator=().


The documentation for this class was generated from the following files:
Contact me in case of errors or questions.
This documentation is powered by Doxygen.
(C) 2000-2002 Doxygen