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_p.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_P_H
6
#
define
QNETWORKCOOKIE_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists for the convenience
13
// of the Network Access framework. This header file may change from
14
// version to version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtNetwork
/
private
/
qtnetworkglobal_p
.
h
>
20
#
include
"QtCore/qdatetime.h"
21
#
include
"QtNetwork/qnetworkcookie.h"
22
23
QT_BEGIN_NAMESPACE
24
25
class
QNetworkCookiePrivate:
public
QSharedData
26
{
27
public
:
28
QNetworkCookiePrivate() =
default
;
29
static
QList<QNetworkCookie> parseSetCookieHeaderLine(QByteArrayView cookieString);
30
31
QDateTime expirationDate;
32
QString domain;
33
QString path;
34
QString comment;
35
QByteArray name;
36
QByteArray value;
37
QNetworkCookie::SameSite sameSite = QNetworkCookie::SameSite::Default;
38
bool
secure =
false
;
39
bool
httpOnly =
false
;
40
};
41
42
namespace
{
43
inline
bool
isLWS(
char
c)
44
{
45
return
c ==
' '
|| c ==
'\t'
|| c ==
'\r'
|| c ==
'\n'
;
46
}
47
48
// Used in qnetworkcookie.cpp and qnetworkreplyhttpimpl.cpp
49
inline
qsizetype nextNonWhitespace(QByteArrayView text, qsizetype from)
50
{
51
// RFC 2616 defines linear whitespace as:
52
// LWS = [CRLF] 1*( SP | HT )
53
// We ignore the fact that CRLF must come as a pair at this point
54
// It's an invalid HTTP header if that happens.
55
while
(from < text.size()) {
56
if
(isLWS(text.at(from)))
57
++from;
58
else
59
return
from;
// non-whitespace
60
}
61
62
// reached the end
63
return
text.size();
64
}
65
}
66
67
QT_END_NAMESPACE
68
69
#
endif
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:824
QNetworkCookie
The QNetworkCookie class holds one network cookie.
Definition
qnetworkcookie.h:24
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
ADAY
#define ADAY
Definition
qnetworkcookie.cpp:607
checkStaticArray
static bool checkStaticArray(int &val, QByteArrayView dateString, int at, const char *array, int size)
Definition
qnetworkcookie.cpp:583
AMONTH
#define AMONTH
Definition
qnetworkcookie.cpp:608
isValueSeparator
static bool isValueSeparator(char c)
Definition
qnetworkcookie.cpp:577
isWhitespace
static bool isWhitespace(char c)
Definition
qnetworkcookie.cpp:580
parseDateString
static QDateTime parseDateString(QByteArrayView dateString)
Definition
qnetworkcookie.cpp:630
nextField
static std::pair< QByteArray, QByteArray > nextField(QByteArrayView text, qsizetype &position, bool isNameValue)
Definition
qnetworkcookie.cpp:379
AYEAR
#define AYEAR
Definition
qnetworkcookie.cpp:609
months
static const char months[]
Definition
qnetworkcookie.cpp:556
zones
static const char zones[]
Definition
qnetworkcookie.cpp:536
isNumber
static bool isNumber(char s)
Definition
qnetworkcookie.cpp:571
zoneOffsets
static const int zoneOffsets[]
Definition
qnetworkcookie.cpp:554
isTerminator
static bool isTerminator(char c)
Definition
qnetworkcookie.cpp:574
qtbase
src
network
access
qnetworkcookie_p.h
Generated on
for Qt by
1.18.0