7#include "QtNetwork/qnetworkcookie.h"
8#include "QtCore/qurl.h"
9#include "QtCore/qdatetime.h"
10#if QT_CONFIG(topleveldomain)
11#include "private/qtldurl_p.h"
97 return d_func()->allCookies;
112 d->allCookies = cookieList;
168 cookie.normalize(
url);
207 end =
d->allCookies.constEnd();
213 if (!(*it).isSessionCookie() && (*it).expirationDate() <
now)
220 domain = domain.
mid(1);
221#if QT_CONFIG(topleveldomain)
231 while (insertIt !=
result.end()) {
232 if (insertIt->path().size() <
it->path().
size()) {
234 insertIt =
result.insert(insertIt, *
it);
242 if (insertIt ==
result.end())
268 d->allCookies += cookie;
303 for (
it =
d->allCookies.begin();
it !=
d->allCookies.end(); ++
it) {
304 if (
it->hasSameIdentifier(cookie)) {
305 d->allCookies.erase(
it);
326 domain = domain.
mid(1);
343#include "moc_qnetworkcookiejar.cpp"
\inmodule QtCore\reentrant
static QDateTime currentDateTimeUtc()
The QNetworkCookieJar class implements a simple jar of QNetworkCookie objects.
void setAllCookies(const QList< QNetworkCookie > &cookieList)
Sets the internal list of cookies held by this cookie jar to be cookieList.
virtual ~QNetworkCookieJar()
Destroys this cookie jar object and discards all cookies stored in it.
QList< QNetworkCookie > allCookies() const
Returns all cookies stored in this cookie jar.
virtual QList< QNetworkCookie > cookiesForUrl(const QUrl &url) const
Returns the cookies to be added to when a request is sent to url.
virtual bool insertCookie(const QNetworkCookie &cookie)
QNetworkCookieJar(QObject *parent=nullptr)
Creates a QNetworkCookieJar object and sets the parent object to be parent.
virtual bool updateCookie(const QNetworkCookie &cookie)
virtual bool validateCookie(const QNetworkCookie &cookie, const QUrl &url) const
virtual bool deleteCookie(const QNetworkCookie &cookie)
virtual bool setCookiesFromUrl(const QList< QNetworkCookie > &cookieList, const QUrl &url)
Adds the cookies in the list cookieList to this cookie jar.
The QNetworkCookie class holds one network cookie.
bool isSessionCookie() const
Returns true if this cookie is a session cookie.
QString domain() const
Returns the domain this cookie is associated with.
QDateTime expirationDate() const
Returns the expiration date for this cookie.
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString host(ComponentFormattingOptions=FullyDecoded) const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
QString scheme() const
Returns the scheme of the URL.
QString path(ComponentFormattingOptions options=FullyDecoded) const
Returns the path of the URL.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static bool isEncrypted(const my_mach_header *header)
static QT_BEGIN_NAMESPACE bool qIsEffectiveTLD(QStringView domain)
static bool isParentDomain(const QString &domain, const QString &reference)
static bool isParentPath(const QString &path, const QString &reference)
GLsizei const GLchar *const * path
QUrl url("example.com")
[constructor-url-reference]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent