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


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) |
| datetime & | operator= (const datetime &other) |
| datetime & | operator= (const string &s) |
| void | copyFrom (const component &other) |
| ref< component > | clone () 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 () |
Date and time (basic type).
| enum DaysOfWeek |
| enum Months |
| enum TimeZones |
| 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 time_t | t, | |
| const int | zone = GMT | |||
| ) |
| ~datetime | ( | ) |
| ref< component > clone | ( | ) | const [virtual] |
| void copyFrom | ( | const component & | other | ) | [virtual] |
Replace data in this component by data in other component.
Both components must be of the same type.
| std::bad_cast_exception | if the components are not of the same (dynamic) type |
| 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.
| 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).
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 |
Referenced by datetimeUtils::toLocalTime(), and datetimeUtils::toUniversalTime().
| 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 |
| 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] |
Parse RFC-822/MIME data for this component.
| buffer | input buffer | |
| position | current position in the input buffer | |
| end | end position in the input buffer | |
| newPosition | will receive the new position in the input buffer |
Implements component.
References datetime::APRIL, datetime::AUGUST, vmime::begin(), datetime::CDT, datetime::CST, datetime::DECEMBER, datetime::EDT, vmime::end(), datetime::EST, datetime::FEBRUARY, datetime::getYear(), datetime::GMT, parserHelpers::isAlpha(), parserHelpers::isDigit(), parserHelpers::isSpace(), datetime::JANUARY, datetime::JULY, datetime::JUNE, datetime::MARCH, datetime::MAY, datetime::MDT, datetime::MST, datetime::NOVEMBER, datetime::now(), datetime::OCTOBER, datetime::PDT, datetime::PST, datetime::SEPTEMBER, component::setParsedBounds(), and parserHelpers::toLower().
Referenced by relay::parse().
| 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 | ) |
References vmime::lineLengthLimits::max.
| void setMonth | ( | const int | month | ) |
References datetimeUtils::getWeekOfYear().
| 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 | ) |
References datetimeUtils::getDayOfWeek().
| void setZone | ( | const int | zone | ) |
Referenced by datetimeUtils::toLocalTime(), and datetimeUtils::toUniversalTime().
1.6.2