00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _SOCKETS_HttpdCookies_H
00030 #define _SOCKETS_HttpdCookies_H
00031
00032 #include "sockets-config.h"
00033 #include <list>
00034 #include <string>
00035
00036 #ifdef SOCKETS_NAMESPACE
00037 namespace SOCKETS_NAMESPACE {
00038 #endif
00039
00040
00042
00043
00044
00046 class HTTPSocket;
00047
00052 class HttpdCookies
00053 {
00056 struct COOKIE
00057 {
00058 COOKIE(const std::string& n,const std::string& v) : name(n),value(v) {}
00059 std::string name;
00060 std::string value;
00061 };
00063 typedef std::list<COOKIE *> cookie_v;
00064 public:
00065 HttpdCookies();
00066 HttpdCookies(const std::string& query_string);
00067 ~HttpdCookies();
00068
00069
00070 bool getvalue(const std::string&,std::string&);
00071 void replacevalue(const std::string& ,const std::string& );
00072 void replacevalue(const std::string& ,long);
00073 void replacevalue(const std::string& ,int);
00074 size_t getlength(const std::string& );
00075 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,const std::string& v);
00076 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,long v);
00077 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,int v);
00078 const std::string& expiredatetime();
00079
00080 cookie_v& GetHttpdCookies() { return m_cookies; }
00081
00082 private:
00083 cookie_v m_cookies;
00084 std::string m_date;
00085 };
00086
00087
00088 #ifdef SOCKETS_NAMESPACE
00089 }
00090 #endif
00091
00092 #endif // _SOCKETS_HttpdCookies_H