00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _COOKIES_H
00021 #define _COOKIES_H
00022
00023 #ifdef _WIN32
00024 #define STL_USING_LIST
00025 #include <stlhelper.h>
00026 #else
00027 #include <list>
00028 #endif
00029
00030 namespace Cgi {
00031
00033
00034 typedef struct cookiestruct
00035 {
00036
00037 char *name;
00038 char *value;
00039 } COOKIE;
00040 typedef std::list<COOKIE *> cookie_v;
00041
00043
00044 class Cookies {
00045 public:
00050 Cookies(void);
00057 Cookies(char *query_string);
00061 ~Cookies(void);
00062 int getvalue(char *,char *,short);
00063 void replacevalue(char *,char *);
00064 void replacevalue(char *,long);
00065 void replacevalue(char *,int);
00066 int getlength(char *);
00067 void setcookie(char *,char *,char *,char *);
00068 void setcookie(char *,char *,char *,long);
00069 void setcookie(char *,char *,char *,int);
00070 void expiredatetime(char *);
00071
00072 cookie_v& GetCookies() { return m_cookies; }
00073
00074 private:
00075
00076 cookie_v m_cookies;
00077 };
00078
00079 }
00080 #endif // _COOKIES_H