#include <httpDate.h>
Public Member Functions | |
HTTPDate () | |
HTTPDate (time_t time) | |
HTTPDate (const string &format) | |
Decodes the string into a sensible date. | |
HTTPDate (const HTTPDate ©) | |
void | operator= (const HTTPDate ©) |
bool | is_valid () const |
Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.). | |
string | get_string () const |
time_t | get_time () const |
Returns the date as a C time_t value. | |
bool | operator== (const HTTPDate &other) const |
bool | operator!= (const HTTPDate &other) const |
bool | operator< (const HTTPDate &other) const |
bool | operator> (const HTTPDate &other) const |
int | compare_to (const HTTPDate &other) const |
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. | |
void | operator+= (int seconds) |
void | operator-= (int seconds) |
HTTPDate | operator+ (int seconds) const |
HTTPDate | operator- (int seconds) const |
int | operator- (const HTTPDate &other) const |
bool | input (istream &in) |
void | output (ostream &out) const |
Static Public Member Functions | |
HTTPDate | now () |
Returns an HTTPDate that represents the current time and date. | |
Static Private Member Functions | |
string | get_token (const string &str, size_t &pos) |
Extracts the next token from the string starting at the indicated position. | |
Private Attributes | |
time_t | _time |
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.
Definition at line 44 of file httpDate.h.
|
Definition at line 31 of file httpDate.I. References INLINE. Referenced by compare_to(), and operator=(). |
|
Definition at line 42 of file httpDate.I. References INLINE. |
|
Decodes the string into a sensible date. Returns 0 (!is_valid()) if the string cannot be correctly decoded. Definition at line 51 of file httpDate.cxx. |
|
Definition at line 53 of file httpDate.I. References _time. |
|
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.
Definition at line 174 of file httpDate.I. References _time, HTTPDate(), and INLINE. |
|
Definition at line 243 of file httpDate.cxx. References months. |
|
Returns the date as a C time_t value.
Definition at line 109 of file httpDate.I. |
|
Extracts the next token from the string starting at the indicated position. Returns the token and updates pos. When the last token has been extracted, returns empty string. A token is defined as a contiguous sequence of digits or letters. If it is a sequence of letters, the function quietly truncates it to three letters before returning, and forces the first letter to capital and the second two to lowercase. If it is a sequence of digits, the function also returns the next character following the last digit (unless it is a letter). Definition at line 346 of file httpDate.cxx. |
|
Definition at line 273 of file httpDate.cxx. |
|
Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source string could not be parsed.).
Definition at line 96 of file httpDate.I. References _time. |
|
Returns an HTTPDate that represents the current time and date.
Definition at line 79 of file httpDate.I. |
|
Definition at line 133 of file httpDate.I. |
|
Definition at line 210 of file httpDate.I. |
|
Definition at line 186 of file httpDate.I. |
|
Definition at line 234 of file httpDate.I. |
|
Definition at line 222 of file httpDate.I. |
|
Definition at line 198 of file httpDate.I. |
|
Definition at line 145 of file httpDate.I. |
|
Definition at line 64 of file httpDate.I. References HTTPDate(), and NULL. |
|
Definition at line 121 of file httpDate.I. |
|
Definition at line 157 of file httpDate.I. |
|
Definition at line 309 of file httpDate.cxx. References size_t. |
|
Definition at line 77 of file httpDate.h. Referenced by compare_to(), get_time(), HTTPDate(), is_valid(), now(), operator!=(), operator+=(), operator<(), operator==(), and operator>(). |