00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ZenLib_Format_Http_CookiesH
00015 #define ZenLib_Format_Http_CookiesH
00016
00017
00018
00019 #include <string>
00020 #include <ctime>
00021 #include <map>
00022 #include <sstream>
00023
00024
00025 namespace ZenLib
00026 {
00027
00028 namespace Format
00029 {
00030
00031 namespace Http
00032 {
00033
00034
00035
00036
00037
00038 struct Cookie
00039 {
00040 std::string Value;
00041 std::time_t Expires;
00042 std::string Path;
00043 std::string Domain;
00044 bool Secure;
00045
00046 Cookie()
00047 {
00048 Expires=0;
00049 Secure=false;
00050 }
00051 };
00052
00053 extern std::string EmptyString;
00054
00055 class Cookies : public std::map<std::string, Cookie>
00056 {
00057 public :
00058
00059 Cookies();
00060
00061
00062 size_t Set(const std::string &Name, const std::string &Value=EmptyString, std::time_t Expires=(std::time_t)-1, const std::string &Path=EmptyString, const std::string &Domain=EmptyString, bool Secure=false);
00063 Cookie &Get(const std::string &Name);
00064 void Create_Lines(std::ostream& Out);
00065 };
00066
00067 }
00068
00069 }
00070
00071 }
00072
00073 #endif