Molybden API
Loading...
Searching...
No Matches
cookies.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_COOKIE_STORE_HPP
6#define MOLYBDEN_COOKIE_STORE_HPP
7
8#include <memory>
9#include <vector>
10#include <string>
11
12namespace molybden {
13
14class Profile;
15struct Cookie;
16
32class Cookies {
33 public:
34 virtual ~Cookies() = default;
35
39 virtual std::shared_ptr<Profile> profile() = 0;
40
48 virtual std::vector<Cookie> list() = 0;
49
59 virtual std::vector<Cookie> list(const std::string& url) = 0;
60
68 virtual void deleteAll() = 0;
69
78 virtual void deleteCookie(const Cookie& cookie) = 0;
79
89 virtual void setCookie(const Cookie& cookie) = 0;
90
101 virtual void persist() = 0;
102};
103
104} // namespace molybden
105
106#endif // MOLYBDEN_COOKIE_STORE_HPP
A service that allows working with the session and persistent cookies.
Definition cookies.hpp:32
virtual void deleteCookie(const Cookie &cookie)=0
Deletes all the cookies from the cookie store and returns the number of deleted cookies.
virtual void setCookie(const Cookie &cookie)=0
Sets the cookie.
virtual std::vector< Cookie > list()=0
Returns a list of all the cookies available in the cookie store.
virtual void deleteAll()=0
Deletes the given cookie from the cookie store.
virtual void persist()=0
Persists all the changes performed to the cookie store.
virtual std::vector< Cookie > list(const std::string &url)=0
Returns a list of cookies for the given url.
virtual std::shared_ptr< Profile > profile()=0
The profile of this cookie store.