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 bool getvalue(const std::string&,std::string&) const;
00070 void replacevalue(const std::string& ,const std::string& );
00071 void replacevalue(const std::string& ,long);
00072 void replacevalue(const std::string& ,int);
00073 size_t getlength(const std::string& ) const;
00074 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,const std::string& v);
00075 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,long v);
00076 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,int v);
00077 const std::string& expiredatetime() const;
00078
00079 cookie_v& GetHttpdCookies() { return m_cookies; }
00080
00081 private:
00082 cookie_v m_cookies;
00083 mutable std::string m_date;
00084 };
00085
00086
00087 #ifdef SOCKETS_NAMESPACE
00088 }
00089 #endif
00090
00091 #endif // _SOCKETS_HttpdCookies_H