Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qnetworkcookie.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QNETWORKCOOKIE_H
6
#
define
QNETWORKCOOKIE_H
7
8
#
include
<
QtNetwork
/
qtnetworkglobal
.
h
>
9
#
include
<
QtCore
/
QSharedDataPointer
>
10
#
include
<
QtCore
/
QList
>
11
#
include
<
QtCore
/
QMetaType
>
12
#
include
<
QtCore
/
QObject
>
13
14
QT_BEGIN_NAMESPACE
15
16
17
class
QByteArray
;
18
class
QDateTime;
19
class
QString;
20
class
QUrl;
21
22
class
QNetworkCookiePrivate;
23
class
Q_NETWORK_EXPORT
QNetworkCookie
24
{
25
Q_GADGET
26
public
:
27
enum
RawForm {
28
NameAndValueOnly,
29
Full
30
};
31
enum
class
SameSite {
32
Default,
33
None,
34
Lax,
35
Strict
36
};
37
Q_ENUM(SameSite)
38
39
explicit
QNetworkCookie(
const
QByteArray &name = QByteArray(),
const
QByteArray &value = QByteArray());
40
QNetworkCookie(
const
QNetworkCookie &other);
41
~QNetworkCookie();
42
QNetworkCookie &operator=(QNetworkCookie &&other)
noexcept
{ swap(other);
return
*
this
; }
43
QNetworkCookie &operator=(
const
QNetworkCookie &other);
44
45
void
swap(QNetworkCookie &other)
noexcept
{ d.swap(other.d); }
46
47
bool
operator==(
const
QNetworkCookie &other)
const
;
48
inline
bool
operator!=(
const
QNetworkCookie &other)
const
49
{
return
!(*
this
== other); }
50
51
bool
isSecure()
const
;
52
void
setSecure(
bool
enable);
53
bool
isHttpOnly()
const
;
54
void
setHttpOnly(
bool
enable);
55
SameSite sameSitePolicy()
const
;
56
void
setSameSitePolicy(SameSite sameSite);
57
58
bool
isSessionCookie()
const
;
59
QDateTime expirationDate()
const
;
60
void
setExpirationDate(
const
QDateTime &date);
61
62
QString domain()
const
;
63
void
setDomain(
const
QString &domain);
64
65
QString path()
const
;
66
void
setPath(
const
QString &path);
67
68
QByteArray name()
const
;
69
void
setName(
const
QByteArray &cookieName);
70
71
QByteArray value()
const
;
72
void
setValue(
const
QByteArray &value);
73
74
QByteArray toRawForm(RawForm form = Full)
const
;
75
76
bool
hasSameIdentifier(
const
QNetworkCookie &other)
const
;
77
void
normalize(
const
QUrl &url);
78
79
#
if
QT_NETWORK_REMOVED_SINCE
(
6
,
7
)
80
static
QList<QNetworkCookie> parseCookies(
const
QByteArray &cookieString);
81
#
endif
82
static
QList<QNetworkCookie> parseCookies(QByteArrayView cookieString);
83
84
private
:
85
QSharedDataPointer<QNetworkCookiePrivate> d;
86
friend
class
QNetworkCookiePrivate;
87
};
88
89
Q_DECLARE_SHARED
(
QNetworkCookie
)
90
91
#
ifndef
QT_NO_DEBUG_STREAM
92
class
QDebug;
93
Q_NETWORK_EXPORT
QDebug
operator<<(QDebug,
const
QNetworkCookie &);
94
#
endif
95
96
QT_END_NAMESPACE
97
98
QT_DECL_METATYPE_EXTERN(QNetworkCookie, Q_NETWORK_EXPORT)
99
100
#
endif
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:824
QNetworkCookie
The QNetworkCookie class holds one network cookie.
Definition
qnetworkcookie.h:24
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
operator<<
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition
qdir.cpp:2620
QNetworkAccessBackendFactory_iid
#define QNetworkAccessBackendFactory_iid
Definition
qnetworkaccessbackend_p.h:155
qtbase
src
network
access
qnetworkcookie.h
Generated on
for Qt by
1.18.0