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
00030
00031 #ifndef _SOCKETS_HttpdCookies_H
00032 #define _SOCKETS_HttpdCookies_H
00033
00034 #include "sockets-config.h"
00035 #include <list>
00036 #include <string>
00037
00038 #ifdef SOCKETS_NAMESPACE
00039 namespace SOCKETS_NAMESPACE {
00040 #endif
00041
00042
00044
00045
00046
00048 class HTTPSocket;
00049
00054 class HttpdCookies
00055 {
00057 typedef std::list<std::pair<std::string, std::string> > cookie_v;
00058
00059 public:
00060 HttpdCookies();
00061 HttpdCookies(const std::string& query_string);
00062 ~HttpdCookies();
00063
00064 void add(const std::string& s);
00065
00066 bool getvalue(const std::string&,std::string&) const;
00067 void replacevalue(const std::string& ,const std::string& );
00068 void replacevalue(const std::string& ,long);
00069 void replacevalue(const std::string& ,int);
00070 size_t getlength(const std::string& ) const;
00071 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,const std::string& v);
00072 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,long v);
00073 void setcookie(HTTPSocket *,const std::string& d,const std::string& p,const std::string& c,int v);
00074 const std::string& expiredatetime() const;
00075
00076 cookie_v& GetHttpdCookies() { return m_cookies; }
00077
00078 void Reset();
00079
00080 private:
00081 cookie_v m_cookies;
00082 mutable std::string m_date;
00083 };
00084
00085
00086 #ifdef SOCKETS_NAMESPACE
00087 }
00088 #endif
00089
00090 #endif // _SOCKETS_HttpdCookies_H
00091