00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef HTTPDATE_H
00016 #define HTTPDATE_H
00017
00018 #include "pandabase.h"
00019
00020 #include <time.h>
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class EXPCL_PANDAEXPRESS HTTPDate {
00031 PUBLISHED:
00032 INLINE HTTPDate();
00033 INLINE HTTPDate(time_t time);
00034 HTTPDate(const string &format);
00035 INLINE HTTPDate(const HTTPDate ©);
00036 INLINE void operator = (const HTTPDate ©);
00037 INLINE static HTTPDate now();
00038
00039 INLINE bool is_valid() const;
00040
00041 string get_string() const;
00042 INLINE time_t get_time() const;
00043
00044 INLINE bool operator == (const HTTPDate &other) const;
00045 INLINE bool operator != (const HTTPDate &other) const;
00046 INLINE bool operator < (const HTTPDate &other) const;
00047 INLINE bool operator > (const HTTPDate &other) const;
00048 INLINE int compare_to(const HTTPDate &other) const;
00049
00050 INLINE void operator += (int seconds);
00051 INLINE void operator -= (int seconds);
00052
00053 INLINE HTTPDate operator + (int seconds) const;
00054 INLINE HTTPDate operator - (int seconds) const;
00055 INLINE int operator - (const HTTPDate &other) const;
00056
00057 bool input(istream &in);
00058 void output(ostream &out) const;
00059
00060 private:
00061 static string get_token(const string &str, size_t &pos);
00062
00063 time_t _time;
00064 };
00065
00066 INLINE istream &operator >> (istream &in, HTTPDate &date);
00067 INLINE ostream &operator << (ostream &out, const HTTPDate &date);
00068
00069 #include "httpDate.I"
00070
00071 #endif