Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qnetworkcookie.cpp File Reference
#include "qnetworkcookie.h"
#include "qnetworkcookie_p.h"
#include "qnetworkrequest.h"
#include "qnetworkreply.h"
#include "QtCore/qbytearray.h"
#include "QtCore/qdatetime.h"
#include "QtCore/qdebug.h"
#include "QtCore/qlist.h"
#include "QtCore/qlocale.h"
#include <QtCore/qregularexpression.h>
#include "QtCore/qstring.h"
#include "QtCore/qstringlist.h"
#include "QtCore/qtimezone.h"
#include "QtCore/qurl.h"
#include "QtNetwork/qhostaddress.h"
#include "private/qobject_p.h"
#include "moc_qnetworkcookie.cpp"
+ Include dependency graph for qnetworkcookie.cpp:

Go to the source code of this file.

Macros

#define ADAY   1
 
#define AMONTH   2
 
#define AYEAR   4
 

Functions

static QPair< QByteArray, QByteArraynextField (const QByteArray &text, int &position, bool isNameValue)
 
static bool isNumber (char s)
 
static bool isTerminator (char c)
 
static bool isValueSeparator (char c)
 
static bool isWhitespace (char c)
 
static bool checkStaticArray (int &val, const QByteArray &dateString, int at, const char *array, int size)
 
static QDateTime parseDateString (const QByteArray &dateString)
 
QDebug operator<< (QDebug s, const QNetworkCookie &cookie)
 

Variables

static const char zones []
 
static const int zoneOffsets [] = {-8, -8, -7, -7, -6, -6, -5, -5, -4, -3, 0, 0, 0, 1, 2, 9 }
 
static const char months []
 

Macro Definition Documentation

◆ ADAY

#define ADAY   1

Definition at line 603 of file qnetworkcookie.cpp.

◆ AMONTH

#define AMONTH   2

Definition at line 604 of file qnetworkcookie.cpp.

◆ AYEAR

#define AYEAR   4

Definition at line 605 of file qnetworkcookie.cpp.

Function Documentation

◆ checkStaticArray()

static bool checkStaticArray ( int &  val,
const QByteArray dateString,
int  at,
const char *  array,
int  size 
)
static

Definition at line 579 of file qnetworkcookie.cpp.

References at, i, j, QByteArray::size(), and str.

Referenced by parseDateString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isNumber()

static bool isNumber ( char  s)
inlinestatic

Definition at line 567 of file qnetworkcookie.cpp.

Referenced by QV4::NumberPrototype::method_isFinite(), QV4::NumberPrototype::method_isNaN(), QV4::QQmlLocaleData::method_toString(), parseDateString(), and QQuick3DModel::translateMeshSource().

+ Here is the caller graph for this function:

◆ isTerminator()

static bool isTerminator ( char  c)
inlinestatic

Definition at line 570 of file qnetworkcookie.cpp.

Referenced by isValueSeparator().

+ Here is the caller graph for this function:

◆ isValueSeparator()

static bool isValueSeparator ( char  c)
inlinestatic

Definition at line 573 of file qnetworkcookie.cpp.

References isTerminator().

Referenced by QNetworkCookiePrivate::parseSetCookieHeaderLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isWhitespace()

static bool isWhitespace ( char  c)
inlinestatic

Definition at line 576 of file qnetworkcookie.cpp.

Referenced by parseDateString().

+ Here is the caller graph for this function:

◆ nextField()

static QPair< QByteArray, QByteArray > nextField ( const QByteArray text,
int &  position,
bool  isNameValue 
)
static

Definition at line 379 of file qnetworkcookie.cpp.

References QString::indexOf(), QString::mid(), nextNonWhitespace(), position(), qMakePair(), QString::size(), text, and QString::trimmed().

Referenced by QNetworkCookiePrivate::parseSetCookieHeaderLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<()

QDebug operator<< ( QDebug  s,
const QNetworkCookie cookie 
)

Definition at line 1088 of file qnetworkcookie.cpp.

References QNetworkCookie::Full, and QNetworkCookie::toRawForm().

+ Here is the call graph for this function:

◆ parseDateString()

static QDateTime parseDateString ( const QByteArray dateString)
static

Definition at line 626 of file qnetworkcookie.cpp.

References ADAY, QDateTime::addSecs(), AMONTH, at, AYEAR, checkStaticArray(), QByteArray::constData(), currentValue, d, date, dateTime, QString::fromLatin1(), i, QStringView::isEmpty(), QTime::isNull(), isNumber(), QDate::isValid(), QDateTime::isValid(), isWhitespace(), j, QRegularExpression::match(), match(), QByteArray::mid(), months, Q_FALLTHROUGH, qDebug, qSwap(), sign(), QByteArray::size(), time, unknown, QTimeZone::UTC, zoneOffsets, and zones.

Referenced by QNetworkCookiePrivate::parseSetCookieHeaderLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ months

const char months[]
static
Initial value:
=
"jan\0"
"feb\0"
"mar\0"
"apr\0"
"may\0"
"jun\0"
"jul\0"
"aug\0"
"sep\0"
"oct\0"
"nov\0"
"dec\0"
"\0"

Definition at line 552 of file qnetworkcookie.cpp.

Referenced by parseDateString().

◆ zoneOffsets

const int zoneOffsets[] = {-8, -8, -7, -7, -6, -6, -5, -5, -4, -3, 0, 0, 0, 1, 2, 9 }
static

Definition at line 550 of file qnetworkcookie.cpp.

Referenced by parseDateString().

◆ zones

const char zones[]
static
Initial value:
=
"pst\0"
"pdt\0"
"mst\0"
"mdt\0"
"cst\0"
"cdt\0"
"est\0"
"edt\0"
"ast\0"
"nst\0"
"gmt\0"
"utc\0"
"bst\0"
"met\0"
"eet\0"
"jst\0"
"\0"

Definition at line 532 of file qnetworkcookie.cpp.

Referenced by parseDateString(), and QWasmWindowStack::windowPositionPreferenceChanged().