18 HTTPDate() : _time(-1) {
25 HTTPDate(time_t time) : _time(time) {
32 HTTPDate(
const HTTPDate ©) : _time(copy._time) {
38 INLINE
void HTTPDate::
57 return (_time != (time_t)(-1));
71 INLINE
bool HTTPDate::
72 operator == (
const HTTPDate &other)
const {
73 return _time == other._time;
79 INLINE
bool HTTPDate::
80 operator != (
const HTTPDate &other)
const {
81 return !operator == (other);
87 INLINE
bool HTTPDate::
88 operator < (
const HTTPDate &other)
const {
89 return _time < other._time;
95 INLINE
bool HTTPDate::
96 operator > (
const HTTPDate &other)
const {
97 return _time > other._time;
106 return (
int)(_time - other._time);
112 INLINE
void HTTPDate::
113 operator += (
int seconds) {
120 INLINE
void HTTPDate::
121 operator -= (
int seconds) {
129 operator + (
int seconds)
const {
137 operator - (
int seconds)
const {
144 INLINE
int HTTPDate::
145 operator - (
const HTTPDate &other)
const {
146 return (
int)(_time - other._time);
150 INLINE std::istream &
151 operator >> (std::istream &in,
HTTPDate &date) {
152 if (!date.input(in)) {
153 in.clear(std::ios::failbit | in.rdstate());
158 INLINE std::ostream &
159 operator << (std::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.