A container for an HTTP-legal time/date indication. More...
Public Member Functions | |
HTTPDate () | |
HTTPDate (HTTPDate const copy) | |
HTTPDate (string format) | |
Decodes the string into a sensible date. | |
HTTPDate (unsigned int time) | |
int | compareTo (HTTPDate const other) |
Returns a number less than zero if this HTTPDate sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent. | |
string | getString () |
unsigned int | getTime () |
Returns the date as a C time_t value. | |
bool | input (istream in) |
bool | isValid () |
Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.) | |
bool | operator!= (HTTPDate const other) |
HTTPDate | operator+ (int seconds) |
HTTPDate | operator+= (int seconds) |
int | operator- (HTTPDate const other) |
HTTPDate | operator- (int seconds) |
HTTPDate | operator-= (int seconds) |
bool | operator< (HTTPDate const other) |
HTTPDate | operator= (HTTPDate const copy) |
bool | operator== (HTTPDate const other) |
bool | operator> (HTTPDate const other) |
output (ostream out) | |
Static Public Member Functions | |
static HTTPDate | now () |
Returns an HTTPDate that represents the current time and date. |
A container for an HTTP-legal time/date indication.
This can accept a string from an HTTP header and will decode it into a C time_t value; conversely, it can accept a time_t value and encode it for output as a string.
HTTPDate | ( | ) |
HTTPDate | ( | string | format | ) |
Decodes the string into a sensible date.
Returns 0 (!is_valid()) if the string cannot be correctly decoded.
Returns a number less than zero if this HTTPDate sorts before the other one, greater than zero if it sorts after, or zero if they are equivalent.
string getString | ( | ) |
bool isValid | ( | ) |
Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.)
bool operator!= | ( | HTTPDate const | other | ) |
bool operator< | ( | HTTPDate const | other | ) |
bool operator== | ( | HTTPDate const | other | ) |
bool operator> | ( | HTTPDate const | other | ) |