Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
40
41static inline bool isLWS(char c)
42{
43 return c == ' ' || c == '\t' || c == '\r' || c == '\n';
44}
45
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:283
QNetworkCookiePrivate()=default
static QList< QNetworkCookie > parseSetCookieHeaderLine(QByteArrayView cookieString)
QNetworkCookie::SameSite sameSite
\inmodule QtCore
Definition qshareddata.h:19
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
qsizetype size() const noexcept
Returns the number of characters in this string.
Definition qstring.h:186
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
Definition qstring.h:1226
QString text
Combined button and popup list for selecting options.
static int nextNonWhitespace(QByteArrayView text, int from)
static bool isLWS(char c)
const GLubyte * c