/* */ #ifndef D_SQLITE3_COOKIE_PARSER_H #define D_SQLITE3_COOKIE_PARSER_H #include "common.h" #include #include #include #include "Cookie.h" namespace aria2 { class Sqlite3CookieParser { public: Sqlite3CookieParser(const std::string& filename); virtual ~Sqlite3CookieParser(); // Loads cookies from sqlite3 database and stores them in cookies. // When loading is successful, cookies stored in cookies initially // are removed. Otherwise, the content of cookies is unchanged. void parse(std::vector& cookies); protected: // Returns SQL select statement to get 1 record of cookie. The sql // must return 6 columns in the following order: host, path, // secure(1 for secure, 0 for not), expiry(utc, unix time), name, // value, last access time(utc, unix time) virtual const std::string& getQuery() const = 0; private: sqlite3* db_; }; } // namespace aria2 #endif // D_SQLITE3_COOKIE_PARSER_H