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