MCPcopy Create free account
hub / github.com/JosephP91/curlcpp / curl_cookie

Class curl_cookie

include/curl_cookie.h:44–93  ·  view source on GitHub ↗

* This class represents a generic cookie handler. It allows a user to get * and set cookie for a domain, in an easy way and without caring about resources * allocation and deallocation. */

Source from the content-addressed store, hash-verified

42 * allocation and deallocation.
43 */
44 class curl_cookie {
45 public:
46 /**
47 * This constructor allow you to specify a curl_easy object.
48 */
49 explicit curl_cookie(curl_easy &easy) : easy(easy) {}
50 /**
51 * This method allow you to set the cookie file from where to read initial cookies.
52 * If you pass an empty string or a string containing a non existing file's path,
53 * the cookie engine will be initialized, but without reading initial cookies.
54 */
55 void set_file(const std::string&);
56 /**
57 * This method allow you to specify a string that represents a cookie. Such a cookie
58 * can be either a single line in Netscape / Mozilla format or just regular HTTP-style
59 * header (Set-Cookie: ...) format. This will also enable the cookie engine. This adds
60 * that single cookie to the internal cookie store.
61 */
62 void set(curl::cookie &);
63 /**
64 * This method overloads the one previously declared allowing to specify a vector of cookies.
65 */
66 void set(const std::vector<curl::cookie> &);
67 /**
68 * This method allow you to get all known cookies for a specific domain.
69 */
70 curlcpp_cookies get() const NOEXCEPT;
71 /**
72 * This method erases all cookies held in memory.
73 */
74 void erase();
75 /**
76 * This method writes all the cookies held in memory to the file specifiied with
77 * set_cookiejar_file method.
78 */
79 void flush();
80 /**
81 * This method erases all the session cookies held in memory.
82 */
83 void erase_session();
84 /**
85 * This method loads all the cookies from the file specified with set_cookie_file method.
86 */
87 void reload();
88 private:
89 /**
90 * Istance on curl_easy class.
91 */
92 curl_easy &easy;
93 };
94}
95
96#endif /* CURL_COOKIE_H */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected