18HTTPDate() : _time(-1) {
25HTTPDate(time_t time) : _time(time) {
32HTTPDate(
const HTTPDate ©) : _time(copy._time) {
57 return (_time != (time_t)(-1));
72operator == (
const HTTPDate &other)
const {
73 return _time == other._time;
80operator != (
const HTTPDate &other)
const {
81 return !operator == (other);
88operator < (
const HTTPDate &other)
const {
89 return _time < other._time;
96operator > (
const HTTPDate &other)
const {
97 return _time > other._time;
106 return (
int)(_time - other._time);
112INLINE
void HTTPDate::
113operator += (
int seconds) {
120INLINE
void HTTPDate::
121operator -= (
int seconds) {
129operator + (
int seconds)
const {
137operator - (
int seconds)
const {
145operator - (
const HTTPDate &other)
const {
146 return (
int)(_time - other._time);
151operator >> (std::istream &in,
HTTPDate &date) {
152 if (!date.input(in)) {
153 in.clear(std::ios::failbit | in.rdstate());
159operator << (std::ostream &out,
const HTTPDate &date) {
A container for an HTTP-legal time/date indication.
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 ...
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.
bool is_valid() const
Returns true if the date is meaningful, or false if it is -1 (which generally indicates the source st...