Qt 6.x
The Qt SDK
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
4#ifndef QNETWORKCOOKIE_P_H
5#define QNETWORKCOOKIE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the Network Access framework. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19#include "QtCore/qdatetime.h"
20#include "QtNetwork/qnetworkcookie.h"
21
23
25{
26public:
29
37 bool secure = false;
38 bool httpOnly = false;
39};
40
41static inline bool isLWS(char c)
42{
43 return c == ' ' || c == '\t' || c == '\r' || c == '\n';
44}
45
46static int nextNonWhitespace(const QByteArray &text, int from)
47{
48 // RFC 2616 defines linear whitespace as:
49 // LWS = [CRLF] 1*( SP | HT )
50 // We ignore the fact that CRLF must come as a pair at this point
51 // It's an invalid HTTP header if that happens.
52 while (from < text.size()) {
53 if (isLWS(text.at(from)))
54 ++from;
55 else
56 return from; // non-whitespace
57 }
58
59 // reached the end
60 return text.size();
61}
62
64
65#endif
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore\reentrant
Definition qdatetime.h:257
Definition qlist.h:74
QNetworkCookiePrivate()=default
static QList< QNetworkCookie > parseSetCookieHeaderLine(const QByteArray &cookieString)
QNetworkCookie::SameSite sameSite
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
qsizetype size() const
Returns the number of characters in this string.
Definition qstring.h:182
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
Definition qstring.h:1079
QString text
Combined button and popup list for selecting options.
static bool isLWS(char c)
static int nextNonWhitespace(const QByteArray &text, int from)
const GLubyte * c