Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QHttpHeaderParser Class Reference

#include <qhttpheaderparser_p.h>

+ Collaboration diagram for QHttpHeaderParser:

Public Member Functions

 QHttpHeaderParser ()
 
void clear ()
 
bool parseHeaders (QByteArrayView headers)
 
bool parseStatus (QByteArrayView status)
 
const QList< QPair< QByteArray, QByteArray > > & headers () const
 
void setStatusCode (int code)
 
int getStatusCode () const
 
int getMajorVersion () const
 
void setMajorVersion (int version)
 
int getMinorVersion () const
 
void setMinorVersion (int version)
 
QString getReasonPhrase () const
 
void setReasonPhrase (const QString &reason)
 
QByteArray firstHeaderField (const QByteArray &name, const QByteArray &defaultValue=QByteArray()) const
 
QByteArray combinedHeaderValue (const QByteArray &name, const QByteArray &defaultValue=QByteArray()) const
 
QList< QByteArrayheaderFieldValues (const QByteArray &name) const
 
void setHeaderField (const QByteArray &name, const QByteArray &data)
 
void prependHeaderField (const QByteArray &name, const QByteArray &data)
 
void appendHeaderField (const QByteArray &name, const QByteArray &data)
 
void removeHeaderField (const QByteArray &name)
 
void clearHeaders ()
 
void setMaxHeaderFieldSize (qsizetype size)
 
qsizetype maxHeaderFieldSize () const
 
void setMaxTotalHeaderSize (qsizetype size)
 
qsizetype maxTotalHeaderSize () const
 
void setMaxHeaderFields (qsizetype count)
 
qsizetype maxHeaderFields () const
 

Detailed Description

Definition at line 46 of file qhttpheaderparser_p.h.

Constructor & Destructor Documentation

◆ QHttpHeaderParser()

QT_BEGIN_NAMESPACE QHttpHeaderParser::QHttpHeaderParser ( )

Definition at line 10 of file qhttpheaderparser.cpp.

Member Function Documentation

◆ appendHeaderField()

void QHttpHeaderParser::appendHeaderField ( const QByteArray name,
const QByteArray data 
)

Definition at line 183 of file qhttpheaderparser.cpp.

References QList< T >::append(), and qMakePair().

Referenced by QHttpNetworkReplyPrivate::appendHeaderField().

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

◆ clear()

void QHttpHeaderParser::clear ( )

Definition at line 17 of file qhttpheaderparser.cpp.

References QString::clear(), and QList< T >::clear().

Referenced by QHttpNetworkReplyPrivate::clearHttpLayerInformation().

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

◆ clearHeaders()

void QHttpHeaderParser::clearHeaders ( )

Definition at line 188 of file qhttpheaderparser.cpp.

References QList< T >::clear().

Referenced by QHttpNetworkHeaderPrivate::clearHeaders().

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

◆ combinedHeaderValue()

QByteArray QHttpHeaderParser::combinedHeaderValue ( const QByteArray name,
const QByteArray defaultValue = QByteArray() 
) const

Definition at line 146 of file qhttpheaderparser.cpp.

References headerFieldValues(), and QList< T >::isEmpty().

+ Here is the call graph for this function:

◆ firstHeaderField()

QByteArray QHttpHeaderParser::firstHeaderField ( const QByteArray name,
const QByteArray defaultValue = QByteArray() 
) const

Definition at line 136 of file qhttpheaderparser.cpp.

References Qt::CaseInsensitive, QList< T >::constBegin(), QList< T >::constEnd(), and it.

Referenced by QHttpNetworkHeaderPrivate::contentLength(), and QHttpNetworkReplyPrivate::removeAutoDecompressHeader().

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

◆ getMajorVersion()

int QHttpHeaderParser::getMajorVersion ( ) const

Definition at line 203 of file qhttpheaderparser.cpp.

Referenced by QHttpNetworkReplyPrivate::readHeader().

+ Here is the caller graph for this function:

◆ getMinorVersion()

int QHttpHeaderParser::getMinorVersion ( ) const

Definition at line 213 of file qhttpheaderparser.cpp.

Referenced by QHttpNetworkReplyPrivate::readHeader().

+ Here is the caller graph for this function:

◆ getReasonPhrase()

QString QHttpHeaderParser::getReasonPhrase ( ) const

Definition at line 223 of file qhttpheaderparser.cpp.

◆ getStatusCode()

int QHttpHeaderParser::getStatusCode ( ) const

Definition at line 193 of file qhttpheaderparser.cpp.

Referenced by QHttpNetworkReplyPrivate::expectContent(), QHttpNetworkReplyPrivate::isRedirecting(), and QHttpNetworkReplyPrivate::shouldEmitSignals().

+ Here is the caller graph for this function:

◆ headerFieldValues()

QList< QByteArray > QHttpHeaderParser::headerFieldValues ( const QByteArray name) const

Definition at line 154 of file qhttpheaderparser.cpp.

References Qt::CaseInsensitive, QList< T >::constBegin(), QList< T >::constEnd(), and it.

Referenced by combinedHeaderValue(), and QHttpNetworkHeaderPrivate::headerFieldValues().

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

◆ headers()

const QList< QPair< QByteArray, QByteArray > > & QHttpHeaderParser::headers ( ) const

Definition at line 131 of file qhttpheaderparser.cpp.

Referenced by QHttpNetworkRequest::header(), and QHttpNetworkHeaderPrivate::headers().

+ Here is the caller graph for this function:

◆ maxHeaderFields()

qsizetype QHttpHeaderParser::maxHeaderFields ( ) const
inline

Definition at line 83 of file qhttpheaderparser_p.h.

◆ maxHeaderFieldSize()

qsizetype QHttpHeaderParser::maxHeaderFieldSize ( ) const
inline

Definition at line 77 of file qhttpheaderparser_p.h.

◆ maxTotalHeaderSize()

qsizetype QHttpHeaderParser::maxTotalHeaderSize ( ) const
inline

Definition at line 80 of file qhttpheaderparser_p.h.

◆ parseHeaders()

bool QHttpHeaderParser::parseHeaders ( QByteArrayView  headers)

Definition at line 37 of file qhttpheaderparser.cpp.

References QString::chop(), QString::endsWith(), fieldNameCheck(), QString::first(), header(), QString::indexOf(), QList< T >::isEmpty(), line, Q_ASSERT, qMakePair(), QString::size(), QString::sliced(), and QString::trimmed().

Referenced by QHttpNetworkReplyPrivate::parseHeader().

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

◆ parseStatus()

bool QHttpHeaderParser::parseStatus ( QByteArrayView  status)

Definition at line 92 of file qhttpheaderparser.cpp.

References QByteArrayView::at(), QString::fromLatin1(), i, QByteArrayView::indexOf(), j, ok, QByteArrayView::size(), QByteArrayView::sliced(), QByteArrayView::startsWith(), and QString::toInt().

Referenced by QHttpNetworkReplyPrivate::parseStatus().

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

◆ prependHeaderField()

void QHttpHeaderParser::prependHeaderField ( const QByteArray name,
const QByteArray data 
)

Definition at line 178 of file qhttpheaderparser.cpp.

References QList< T >::prepend(), and qMakePair().

Referenced by QHttpNetworkHeaderPrivate::prependHeaderField().

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

◆ removeHeaderField()

void QHttpHeaderParser::removeHeaderField ( const QByteArray name)

Definition at line 164 of file qhttpheaderparser.cpp.

References Qt::CaseInsensitive, QString::first(), header(), and QList< T >::removeIf().

Referenced by QHttpNetworkReplyPrivate::removeAutoDecompressHeader(), and setHeaderField().

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

◆ setHeaderField()

void QHttpHeaderParser::setHeaderField ( const QByteArray name,
const QByteArray data 
)

Definition at line 172 of file qhttpheaderparser.cpp.

References QList< T >::append(), qMakePair(), and removeHeaderField().

Referenced by QHttpNetworkHeaderPrivate::setHeaderField().

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

◆ setMajorVersion()

void QHttpHeaderParser::setMajorVersion ( int  version)

Definition at line 208 of file qhttpheaderparser.cpp.

◆ setMaxHeaderFields()

void QHttpHeaderParser::setMaxHeaderFields ( qsizetype  count)
inline

Definition at line 82 of file qhttpheaderparser_p.h.

◆ setMaxHeaderFieldSize()

void QHttpHeaderParser::setMaxHeaderFieldSize ( qsizetype  size)
inline

Definition at line 76 of file qhttpheaderparser_p.h.

◆ setMaxTotalHeaderSize()

void QHttpHeaderParser::setMaxTotalHeaderSize ( qsizetype  size)
inline

Definition at line 79 of file qhttpheaderparser_p.h.

◆ setMinorVersion()

void QHttpHeaderParser::setMinorVersion ( int  version)

Definition at line 218 of file qhttpheaderparser.cpp.

◆ setReasonPhrase()

void QHttpHeaderParser::setReasonPhrase ( const QString reason)

Definition at line 228 of file qhttpheaderparser.cpp.

◆ setStatusCode()

void QHttpHeaderParser::setStatusCode ( int  code)

Definition at line 198 of file qhttpheaderparser.cpp.


The documentation for this class was generated from the following files: