Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qbytearray.cpp File Reference

(177cd123d29f818413db4bb7a9d92b8485c95947)

#include "qbytearray.h"
#include "qbytearraymatcher.h"
#include "private/qtools_p.h"
#include "qhashfunctions.h"
#include "qlist.h"
#include "qlocale_p.h"
#include "qlocale_tools_p.h"
#include "private/qnumeric_p.h"
#include "private/qsimd_p.h"
#include "qstringalgorithms_p.h"
#include "qscopedpointer.h"
#include "qstringconverter_p.h"
#include <qdatastream.h>
#include <qmath.h>
#include <zconf.h>
#include <zlib.h>
#include <qxpfunctional.h>
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <QtCore/q26numeric.h>
#include <string>
+ Include dependency graph for qbytearray.cpp:

Go to the source code of this file.

Typedefs

using CompressSizeHint_t = quint32
 

Enumerations

enum class  ZLibOp : bool { Compression , Decompression , Compression , Decompression }
 
enum class  ZLibOp : bool { Compression , Decompression , Compression , Decompression }
 

Functions

static constexpr uchar asciiUpper (uchar c)
 
static constexpr uchar asciiLower (uchar c)
 
int qstrnicmp (const char *str1, qsizetype len1, const char *str2, qsizetype len2)
 
static Q_DECL_COLD_FUNCTION const char * zlibOpAsString (ZLibOp op)
 
static Q_DECL_COLD_FUNCTION QByteArray zlibError (ZLibOp op, const char *what)
 
static Q_DECL_COLD_FUNCTION QByteArray dataIsNull (ZLibOp op)
 
static Q_DECL_COLD_FUNCTION QByteArray lengthIsNegative (ZLibOp op)
 
static Q_DECL_COLD_FUNCTION QByteArray tooMuchData (ZLibOp op)
 
static Q_DECL_COLD_FUNCTION QByteArray invalidCompressedData ()
 
static Q_DECL_COLD_FUNCTION QByteArray unexpectedZlibError (ZLibOp op, int err, const char *msg)
 
static QByteArray xxflate (ZLibOp op, QArrayDataPointer< char > out, QByteArrayView input, qxp::function_ref< int(z_stream *) const > init, qxp::function_ref< int(z_stream *, size_t) const > processChunk, qxp::function_ref< void(z_stream *) const > deinit)
 
QByteArray qCompress (const uchar *data, qsizetype nbytes, int compressionLevel)
 
static qsizetype lastIndexOfHelper (const char *haystack, qsizetype l, const char *needle, qsizetype ol, qsizetype from)
 
static qsizetype countCharHelper (QByteArrayView haystack, char needle) noexcept
 
static constexpr bool isUpperCaseAscii (char c)
 
static constexpr bool isLowerCaseAscii (char c)
 
template<typename T>
static QByteArray toCase_template (T &input, uchar(*lookup)(uchar))
 
static void q_fromPercentEncoding (QByteArray *ba, char percent)
 
size_t qHash (const QByteArray::FromBase64Result &key, size_t seed) noexcept
 \qhashold{QByteArray::FromBase64Result}
 

Variables

static const quint16 crc_tbl [16]
 

Typedef Documentation

◆ CompressSizeHint_t

Definition at line 552 of file qbytearray.cpp.

Enumeration Type Documentation

◆ ZLibOp [1/2]

enum class ZLibOp : bool
strong
Enumerator
Compression 
Decompression 
Compression 
Decompression 

Definition at line 554 of file qbytearray.cpp.

◆ ZLibOp [2/2]

enum class ZLibOp : bool
strong
Enumerator
Compression 
Decompression 
Compression 
Decompression 

Definition at line 554 of file qbytearray.cpp.

Function Documentation

◆ asciiLower()

static constexpr uchar asciiLower ( uchar c)
inlinestaticconstexpr

Definition at line 56 of file qbytearray.cpp.

◆ asciiUpper()

static constexpr uchar asciiUpper ( uchar c)
inlinestaticconstexpr

Definition at line 51 of file qbytearray.cpp.

◆ countCharHelper()

static qsizetype countCharHelper ( QByteArrayView haystack,
char needle )
inlinestaticnoexcept

Definition at line 2869 of file qbytearray.cpp.

◆ dataIsNull()

static Q_DECL_COLD_FUNCTION QByteArray dataIsNull ( ZLibOp op)
static

Definition at line 574 of file qbytearray.cpp.

◆ invalidCompressedData()

static Q_DECL_COLD_FUNCTION QByteArray invalidCompressedData ( )
static

Definition at line 592 of file qbytearray.cpp.

◆ isLowerCaseAscii()

static constexpr bool isLowerCaseAscii ( char c)
inlinestaticconstexpr

Definition at line 3013 of file qbytearray.cpp.

Referenced by QByteArray::isUpper().

+ Here is the caller graph for this function:

◆ isUpperCaseAscii()

static constexpr bool isUpperCaseAscii ( char c)
inlinestaticconstexpr

Definition at line 3005 of file qbytearray.cpp.

Referenced by QByteArray::isLower(), and QByteArray::number().

+ Here is the caller graph for this function:

◆ lastIndexOfHelper()

static qsizetype lastIndexOfHelper ( const char * haystack,
qsizetype l,
const char * needle,
qsizetype ol,
qsizetype from )
static

Definition at line 2767 of file qbytearray.cpp.

◆ lengthIsNegative()

static Q_DECL_COLD_FUNCTION QByteArray lengthIsNegative ( ZLibOp op)
static

Definition at line 580 of file qbytearray.cpp.

◆ q_fromPercentEncoding()

static void q_fromPercentEncoding ( QByteArray * ba,
char percent )
static

Definition at line 4717 of file qbytearray.cpp.

Referenced by QByteArray::percentDecoded().

+ Here is the caller graph for this function:

◆ qCompress()

QByteArray qCompress ( const uchar * data,
qsizetype nbytes,
int compressionLevel )
related

Definition at line 693 of file qbytearray.cpp.

References Compression.

◆ qHash()

size_t qHash ( const QByteArray::FromBase64Result & key,
size_t seed )
noexcept

\qhashold{QByteArray::FromBase64Result}

Definition at line 5177 of file qbytearray.cpp.

◆ qstrnicmp()

int qstrnicmp ( const char * str1,
qsizetype len1,
const char * str2,
qsizetype len2 )
Since
5.12

A helper for QByteArray::compare. Compares len1 bytes from str1 to len2 bytes from str2. If len2 is -1, then str2 is expected to be '\0'-terminated.

Definition at line 368 of file qbytearray.cpp.

◆ toCase_template()

template<typename T>
static QByteArray toCase_template ( T & input,
uchar(* lookup )(uchar) )
static

Definition at line 3274 of file qbytearray.cpp.

◆ tooMuchData()

static Q_DECL_COLD_FUNCTION QByteArray tooMuchData ( ZLibOp op)
static

Definition at line 586 of file qbytearray.cpp.

◆ unexpectedZlibError()

static Q_DECL_COLD_FUNCTION QByteArray unexpectedZlibError ( ZLibOp op,
int err,
const char * msg )
static

Definition at line 598 of file qbytearray.cpp.

◆ xxflate()

static QByteArray xxflate ( ZLibOp op,
QArrayDataPointer< char > out,
QByteArrayView input,
qxp::function_ref< int(z_stream *) const > init,
qxp::function_ref< int(z_stream *, size_t) const > processChunk,
qxp::function_ref< void(z_stream *) const > deinit )
static

Definition at line 607 of file qbytearray.cpp.

References Decompression.

◆ zlibError()

static Q_DECL_COLD_FUNCTION QByteArray zlibError ( ZLibOp op,
const char * what )
static

Definition at line 567 of file qbytearray.cpp.

◆ zlibOpAsString()

static Q_DECL_COLD_FUNCTION const char * zlibOpAsString ( ZLibOp op)
static

Definition at line 557 of file qbytearray.cpp.

References Compression, and Decompression.

Variable Documentation

◆ crc_tbl

static const quint16 crc_tbl
static
Initial value:
= {
0x0000, 0x1081, 0x2102, 0x3183,
0x4204, 0x5285, 0x6306, 0x7387,
0x8408, 0x9489, 0xa50a, 0xb58b,
0xc60c, 0xd68d, 0xe70e, 0xf78f
}

Definition at line 471 of file qbytearray.cpp.