datetime Class Reference

Date and time (basic type). More...

Inheritance diagram for datetime:
Inheritance graph
[legend]
Collaboration diagram for datetime:
Collaboration graph
[legend]

List of all members.

Public Types

enum  TimeZones {
  GMT_12 = -720, GMT_11 = -660, GMT_10 = -600, GMT_9 = -540,
  GMT_8 = -480, GMT_7 = -420, GMT_6 = -360, GMT_5 = -300,
  GMT_4 = -240, GMT_3 = -180, GMT_2 = -120, GMT_1 = -60,
  GMT = 0, GMT1 = 60, GMT2 = 120, GMT3 = 180,
  GMT4 = 240, GMT5 = 300, GMT6 = 360, GMT7 = 420,
  GMT8 = 480, GMT9 = 540, GMT10 = 600, GMT11 = 660,
  GMT12 = 720, UT = GMT, EST = GMT_5, EDT = GMT_4,
  CST = GMT_6, CDT = GMT_5, MST = GMT_7, MDT = GMT_6,
  PST = GMT_8, PDT = GMT_7, A = GMT_1, B = GMT_2,
  C = GMT_3, D = GMT_4, E = GMT_5, F = GMT_6,
  G = GMT_7, H = GMT_8, I = GMT_9, K = GMT_10,
  L = GMT_11, M = GMT_12, N = GMT1, O = GMT2,
  P = GMT3, Q = GMT4, R = GMT5, S = GMT6,
  T = GMT7, U = GMT8, V = GMT9, W = GMT10,
  X = GMT11, Y = GMT12, Z = GMT
}
enum  Months {
  JANUARY = 1, FEBRUARY = 2, MARCH = 3, APRIL = 4,
  MAY = 5, JUNE = 6, JULY = 7, AUGUST = 8,
  SEPTEMBER = 9, OCTOBER = 10, NOVEMBER = 11, DECEMBER = 12,
  JAN = 1, FEB = 2, MAR = 3, APR = 4,
  JUN = 6, JUL = 7, AUG = 8, SEP = 9,
  OCT = 10, NOV = 11, DEC = 12
}
enum  DaysOfWeek {
  SUNDAY = 0, MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3,
  THURSDAY = 4, FRIDAY = 5, SATURDAY = 6, SUN = 0,
  MON = 1, TUE = 2, WED = 3, THU = 4,
  FRI = 5, SAT = 6
}

Public Member Functions

 datetime ()
 datetime (const int year, const int month, const int day)
 datetime (const int year, const int month, const int day, const int hour, const int minute, const int second, const int zone=GMT)
 datetime (const datetime &d)
 datetime (const string &date)
 datetime (const time_t t, const int zone=GMT)
 ~datetime ()
int getYear () const
int getMonth () const
int getDay () const
int getHour () const
int getMinute () const
int getSecond () const
int getZone () const
int getWeekDay () const
int getWeek () const
void getTime (int &hour, int &minute, int &second, int &zone) const
void getTime (int &hour, int &minute, int &second) const
void getDate (int &year, int &month, int &day) const
void setYear (const int year)
void setMonth (const int month)
void setDay (const int day)
void setHour (const int hour)
void setMinute (const int minute)
void setSecond (const int second)
void setZone (const int zone)
void setTime (const int hour=0, const int minute=0, const int second=0, const int zone=GMT)
void setDate (const int year, const int month, const int day)
datetimeoperator= (const datetime &other)
datetimeoperator= (const string &s)
void copyFrom (const component &other)
ref< componentclone () const
bool operator== (const datetime &other) const
bool operator!= (const datetime &other) const
bool operator< (const datetime &other) const
bool operator<= (const datetime &other) const
bool operator> (const datetime &other) const
bool operator>= (const datetime &other) const
const std::vector< ref< const
component > > 
getChildComponents () const
void parse (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL)
void generate (utility::outputStream &os, const string::size_type maxLineLength=lineLengthLimits::infinite, const string::size_type curLinePos=0, string::size_type *newLinePos=NULL) const

Static Public Member Functions

static const datetime now ()

Detailed Description

Date and time (basic type).


Member Enumeration Documentation

enum DaysOfWeek
Enumerator:
SUNDAY 
MONDAY 
TUESDAY 
WEDNESDAY 
THURSDAY 
FRIDAY 
SATURDAY 
SUN 
MON 
TUE 
WED 
THU 
FRI 
SAT 
enum Months
Enumerator:
JANUARY 
FEBRUARY 
MARCH 
APRIL 
MAY 
JUNE 
JULY 
AUGUST 
SEPTEMBER 
OCTOBER 
NOVEMBER 
DECEMBER 
JAN 
FEB 
MAR 
APR 
JUN 
JUL 
AUG 
SEP 
OCT 
NOV 
DEC 
enum TimeZones
Enumerator:
GMT_12 
GMT_11 
GMT_10 
GMT_9 
GMT_8 
GMT_7 
GMT_6 
GMT_5 
GMT_4 
GMT_3 
GMT_2 
GMT_1 
GMT 
GMT1 
GMT2 
GMT3 
GMT4 
GMT5 
GMT6 
GMT7 
GMT8 
GMT9 
GMT10 
GMT11 
GMT12 
UT 
EST 
EDT 
CST 
CDT 
MST 
MDT 
PST 
PDT 
A 
B 
C 
D 
E 
F 
G 
H 
I 
K 
L 
M 
N 
O 
P 
Q 
R 
S 
T 
U 
V 
W 
X 
Y 
Z 

Constructor & Destructor Documentation

datetime (  ) 
datetime ( const int  year,
const int  month,
const int  day 
)
datetime ( const int  year,
const int  month,
const int  day,
const int  hour,
const int  minute,
const int  second,
const int  zone = GMT 
)
datetime ( const datetime d  ) 
datetime ( const string date  ) 
datetime ( const time_t  t,
const int  zone = GMT 
)
~datetime (  ) 

Member Function Documentation

ref< component > clone (  )  const [virtual]

Clone this component.

Returns:
a copy of this component

Implements component.

void copyFrom ( const component other  )  [virtual]

Replace data in this component by data in other component.

Both components must be of the same type.

Exceptions:
std::bad_cast_exception if the components are not of the same (dynamic) type
Parameters:
other other component to copy data from

Implements component.

void generate ( utility::outputStream os,
const string::size_type  maxLineLength = lineLengthLimits::infinite,
const string::size_type  curLinePos = 0,
string::size_type *  newLinePos = NULL 
) const [virtual]

Generate RFC-2822/MIME data for this component.

Parameters:
os output stream
maxLineLength maximum line length for output
curLinePos length of the current line in the output buffer
newLinePos will receive the new line position (length of the last line written)

Implements component.

Referenced by relay::generate().

const std::vector< ref< const component > > getChildComponents (  )  const [virtual]

Return the list of children of this component (const version).

Returns:
list of child components

Implements component.

void getDate ( int &  year,
int &  month,
int &  day 
) const
int getDay (  )  const
int getHour (  )  const
int getMinute (  )  const
int getMonth (  )  const
int getSecond (  )  const
void getTime ( int &  hour,
int &  minute,
int &  second 
) const
void getTime ( int &  hour,
int &  minute,
int &  second,
int &  zone 
) const
int getWeek (  )  const
int getWeekDay (  )  const
int getYear (  )  const

Referenced by datetime::parse().

int getZone (  )  const
const datetime now (  )  [static]

Referenced by datetime::parse().

bool operator!= ( const datetime other  )  const
bool operator< ( const datetime other  )  const
bool operator<= ( const datetime other  )  const
datetime & operator= ( const string s  ) 
datetime & operator= ( const datetime other  ) 
bool operator== ( const datetime other  )  const
bool operator> ( const datetime other  )  const
bool operator>= ( const datetime other  )  const
void parse ( const string buffer,
const string::size_type  position,
const string::size_type  end,
string::size_type *  newPosition = NULL 
) [virtual]
void setDate ( const int  year,
const int  month,
const int  day 
)
void setDay ( const int  day  ) 
void setHour ( const int  hour  ) 
void setMinute ( const int  minute  ) 
void setMonth ( const int  month  ) 
void setSecond ( const int  second  ) 
void setTime ( const int  hour = 0,
const int  minute = 0,
const int  second = 0,
const int  zone = GMT 
)
void setYear ( const int  year  ) 
void setZone ( const int  zone  ) 

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

Generated by  doxygen 1.6.2