22 HTTPDate() : _time(-1) {
31 HTTPDate(time_t time) : _time(time) {
40 HTTPDate(
const HTTPDate ©) : _time(copy._time) {
48 INLINE
void HTTPDate::
73 return (_time != (time_t)(-1));
91 INLINE
bool HTTPDate::
92 operator == (
const HTTPDate &other)
const {
93 return _time == other._time;
101 INLINE
bool HTTPDate::
102 operator != (
const HTTPDate &other)
const {
103 return !operator == (other);
111 INLINE
bool HTTPDate::
112 operator < (
const HTTPDate &other)
const {
113 return _time < other._time;
121 INLINE
bool HTTPDate::
122 operator > (
const HTTPDate &other)
const {
123 return _time > other._time;
135 return (
int)(_time - other._time);
143 INLINE
void HTTPDate::
144 operator += (
int seconds) {
153 INLINE
void HTTPDate::
154 operator -= (
int seconds) {
164 operator + (
int seconds)
const {
174 operator - (
int seconds)
const {
183 INLINE
int HTTPDate::
184 operator - (
const HTTPDate &other)
const {
185 return (
int)(_time - other._time);
190 operator >> (istream &in,
HTTPDate &date) {
191 if (!date.input(in)) {
192 in.clear(ios::failbit | in.rdstate());
198 operator << (ostream &out,
const HTTPDate &date) {
bool is_valid() const
Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source st...
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 ...
A container for an HTTP-legal time/date indication.
static HTTPDate now()
Returns an HTTPDate that represents the current time and date.
time_t get_time() const
Returns the date as a C time_t value.