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

(79874205bc496ebb3c0e565eb0c4759b595222e0)

#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 qsizetype q_fromPercentEncoding (QByteArrayView src, char percent, QSpan< char > buffer)
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 553 of file qbytearray.cpp.

Enumeration Type Documentation

◆ ZLibOp [1/2]

enum class ZLibOp : bool
strong
Enumerator
Compression 
Decompression 
Compression 
Decompression 

Definition at line 555 of file qbytearray.cpp.

◆ ZLibOp [2/2]

enum class ZLibOp : bool
strong
Enumerator
Compression 
Decompression 
Compression 
Decompression 

Definition at line 555 of file qbytearray.cpp.

Function Documentation

◆ asciiLower()

constexpr uchar asciiLower ( uchar c)
inlinestaticconstexpr

Definition at line 57 of file qbytearray.cpp.

◆ asciiUpper()

constexpr uchar asciiUpper ( uchar c)
inlinestaticconstexpr

Definition at line 52 of file qbytearray.cpp.

◆ countCharHelper()

qsizetype countCharHelper ( QByteArrayView haystack,
char needle )
inlinestaticnoexcept

Definition at line 2879 of file qbytearray.cpp.

◆ dataIsNull()

Q_DECL_COLD_FUNCTION QByteArray dataIsNull ( ZLibOp op)
static

Definition at line 575 of file qbytearray.cpp.

◆ invalidCompressedData()

Q_DECL_COLD_FUNCTION QByteArray invalidCompressedData ( )
static

Definition at line 593 of file qbytearray.cpp.

◆ isLowerCaseAscii()

constexpr bool isLowerCaseAscii ( char c)
inlinestaticconstexpr

Definition at line 3023 of file qbytearray.cpp.

Referenced by QByteArray::isUpper().

Here is the caller graph for this function:

◆ isUpperCaseAscii()

constexpr bool isUpperCaseAscii ( char c)
inlinestaticconstexpr

Definition at line 3015 of file qbytearray.cpp.

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

Here is the caller graph for this function:

◆ lastIndexOfHelper()

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

Definition at line 2777 of file qbytearray.cpp.

◆ lengthIsNegative()

Q_DECL_COLD_FUNCTION QByteArray lengthIsNegative ( ZLibOp op)
static

Definition at line 581 of file qbytearray.cpp.

◆ q_fromPercentEncoding()

qsizetype q_fromPercentEncoding ( QByteArrayView src,
char percent,
QSpan< char > buffer )
static

Definition at line 4728 of file qbytearray.cpp.

◆ qCompress()

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

Definition at line 694 of file qbytearray.cpp.

References Compression.

◆ qHash()

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

\qhashold{QByteArray::FromBase64Result}

Definition at line 5202 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 369 of file qbytearray.cpp.

◆ toCase_template()

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

Definition at line 3284 of file qbytearray.cpp.

◆ tooMuchData()

Q_DECL_COLD_FUNCTION QByteArray tooMuchData ( ZLibOp op)
static

Definition at line 587 of file qbytearray.cpp.

◆ unexpectedZlibError()

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

Definition at line 599 of file qbytearray.cpp.

◆ xxflate()

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 608 of file qbytearray.cpp.

References Decompression.

◆ zlibError()

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

Definition at line 568 of file qbytearray.cpp.

◆ zlibOpAsString()

Q_DECL_COLD_FUNCTION const char * zlibOpAsString ( ZLibOp op)
static

Definition at line 558 of file qbytearray.cpp.

References Compression, and Decompression.

Variable Documentation

◆ crc_tbl

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 472 of file qbytearray.cpp.