8#include "private/qtools_p.h"
13#include "private/qnumeric_p.h"
14#include "private/qsimd_p.h"
22#include "private/qstdweb_p.h"
39Q_CONSTINIT
const char QByteArray::_empty =
'\0';
44 return c >=
'a' &&
c <=
'z' ?
c & ~0x20 :
c;
49 return c >=
'A' &&
c <=
'Z' ?
c | 0x20 :
c;
54 const char *needle0,
qsizetype needleLen);
76 char *
dst =
new char[strlen(
src) + 1];
99 const size_t len = strlen(
src);
138 return src ?
dst :
nullptr;
180int qstrcmp(
const char *str1,
const char *str2)
182 return (str1 && str2) ? strcmp(str1, str2)
183 : (str1 ? 1 : (str2 ? -1 : 0));
227 const uchar *
s1 =
reinterpret_cast<const uchar *
>(str1);
228 const uchar *
s2 =
reinterpret_cast<const uchar *
>(str2);
234 enum { Incomplete = 256 };
245 }
while (unlimited ||
offset < max);
246 return int(Incomplete);
249#if defined(__SSE4_1__) && !(defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer))
250 enum { PageSize = 4096, PageMask = PageSize - 1 };
251 const __m128i
zero = _mm_setzero_si128();
258 size_t n = PageSize - ((
u1 |
u2) & PageMask);
261 for ( ;
offset + 16 <= maxoffset;
offset +=
sizeof(__m128i)) {
263 __m128i
a = _mm_loadu_si128(
reinterpret_cast<const __m128i *
>(
s1 +
offset));
264 __m128i
b = _mm_loadu_si128(
reinterpret_cast<const __m128i *
>(
s2 +
offset));
267 __m128i cmp = _mm_cmpeq_epi8(
a,
b);
270 cmp = _mm_min_epu8(cmp,
a);
271 cmp = _mm_cmpeq_epi8(cmp,
zero);
287 int res = innerCompare(
n,
false);
288 if (
res != Incomplete)
293 return innerCompare(-1,
true);
317 const uchar *
s1 =
reinterpret_cast<const uchar *
>(str1);
318 const uchar *
s2 =
reinterpret_cast<const uchar *
>(str2);
320 return s1 ? 1 : (
s2 ? -1 : 0);
343 const uchar *
s1 =
reinterpret_cast<const uchar *
>(str1);
344 const uchar *
s2 =
reinterpret_cast<const uchar *
>(str2);
349 return (!
s2 || !*
s2) ? 0 : -1;
354 return len1 == 0 ? 0 : 1;
359 for (
i = 0;
i < len1; ++
i) {
367 return s2[
i] ? -1 : 0;
377 return len1 < len2 ? -1 : 1;
407static void createCRC16Table()
413 for (
i = 0;
i < 16;
i++) {
420#define SET_BIT(x, b, v) (x) |= (v) << (b)
435 printf(
"static const quint16 crc_tbl[16] = {\n");
436 for (
int i = 0;
i < 16;
i +=4)
443 0x0000, 0x1081, 0x2102, 0x3183,
444 0x4204, 0x5285, 0x6306, 0x7387,
445 0x8408, 0x9489, 0xa50a, 0xb58b,
446 0xc60c, 0xd68d, 0xe70e, 0xf78f
478 crc = ((crc >> 4) & 0x0fff) ^
crc_tbl[((crc ^
c) & 15)];
480 crc = ((crc >> 4) & 0x0fff) ^
crc_tbl[((crc ^
c) & 15)];
522#ifndef QT_NO_COMPRESS
534 Q_UNREACHABLE_RETURN(
nullptr);
553 return zlibError(op,
"Input length is negative");
559 return zlibError(op,
"Not enough memory");
571 qWarning(
"%s unexpected zlib error: %s (%d)",
583 if (
out.data() ==
nullptr)
587 const auto initalSize =
out.size;
590 zs.next_in =
reinterpret_cast<uchar *
>(
const_cast<char *
>(
input.data()));
591 if (
const int err =
init(&zs); err != Z_OK)
595 using ZlibChunkSize_t =
decltype(zs.avail_in);
596 static_assert(!std::is_signed_v<ZlibChunkSize_t>);
597 static_assert(std::is_same_v<ZlibChunkSize_t,
decltype(zs.avail_out)>);
598 constexpr auto MaxChunkSize = std::numeric_limits<ZlibChunkSize_t>::max();
600 constexpr auto MaxStatisticsSize = std::numeric_limits<
decltype(zs.total_out)>::max();
602 size_t inputLeft = size_t(
input.size());
609 if (zs.avail_out == 0) {
610 Q_ASSERT(
size_t(
out.size) - initalSize > MaxStatisticsSize ||
611 size_t(
out.size) - initalSize == zs.total_out);
615 if (avail_out == 0) {
617 if (
out.data() ==
nullptr)
622 zs.next_out =
reinterpret_cast<uchar *
>(
out.data()) +
out.size;
623 zs.avail_out = size_t(avail_out) > size_t(MaxChunkSize) ? MaxChunkSize
624 : ZlibChunkSize_t(avail_out);
625 out.size += zs.avail_out;
630 if (zs.avail_in == 0) {
632 zs.avail_in = inputLeft > MaxChunkSize ? MaxChunkSize : ZlibChunkSize_t(inputLeft);
633 inputLeft -= zs.avail_in;
636 res = processChunk(&zs, inputLeft);
637 }
while (
res == Z_OK);
641 out.size -= zs.avail_out;
642 Q_ASSERT(
size_t(
out.size) - initalSize > MaxStatisticsSize ||
643 size_t(
out.size) - initalSize == zs.total_out);
645 out.data()[
out.size] =
'\0';
676 if (compressionLevel < -1 || compressionLevel > 9)
677 compressionLevel = -1;
680 constexpr qsizetype SingleAllocLimit = 256 * 1024;
685 if (nbytes < SingleAllocLimit) {
687 capacity += compressBound(uLong(nbytes));
693 constexpr qsizetype MaxCompressionFactor = 1024;
697 nbytes / MaxCompressionFactor);
701 if (
out.data() ==
nullptr)
708 [=] (z_stream *zs) {
return deflateInit(zs, compressionLevel); },
709 [] (z_stream *zs,
size_t inputLeft) {
710 return deflate(zs, inputLeft ? Z_NO_FLUSH : Z_FINISH);
712 [] (z_stream *zs) { deflateEnd(zs); });
748#ifndef QT_NO_COMPRESS
768 const auto expectedSize = qFromBigEndian<CompressSizeHint_t>(
data);
770 if (expectedSize != 0)
776 if constexpr (MaxDecompressedSize < std::numeric_limits<CompressSizeHint_t>::max()) {
777 if (expectedSize > MaxDecompressedSize)
788 [] (z_stream *zs) {
return inflateInit(zs); },
789 [] (z_stream *zs, size_t) {
return inflate(zs, Z_NO_FLUSH); },
790 [] (z_stream *zs) { inflateEnd(zs); });
1348 || (
len <
size() &&
len < (capacityAtEnd >> 1)))
1891 const auto old = d.
size;
1894 memset(d.
data() + old,
c, d.
size - old);
1930 ::memcpy(dd.data(), d.
data(), dd.size);
1931 dd.data()[dd.size] = 0;
1934 d->reallocate(alloc,
option);
1947 dd.data()[dd.size] = 0;
1986 return (*
this =
ba);
2048 return (*
this =
ba);
2169 *
this =
v.toByteArray();
2198 if (
i < 0 ||
size <= 0)
2330 const auto toRemove_start = d.
begin() +
pos;
2331 copy.d->copyRanges({{d.
begin(), toRemove_start},
2332 {toRemove_start +
len, d.
end()}});
2443 const char *
b = before.
data();
2445 const char *
a = after.
data();
2448 if (
isNull() || (
b ==
a && bsize == asize))
2466 if (bsize == asize) {
2473 }
else if (asize < bsize) {
2475 size_t movestart = 0;
2481 memmove(
d + to,
d + movestart, msize);
2488 memcpy(
d + to,
a, asize);
2498 memmove(
d + to,
d + movestart, msize);
2504 while (
index != -1) {
2538 memmove(
d + moveto,
d + movestart, (moveend - movestart));
2540 memcpy(
d + insertstart,
a, asize);
2541 moveend = movestart - bsize;
2619 result.reserve(resultSize);
2620 if (
result.capacity() != resultSize)
2626 char *
end =
result.d.data() + sizeSoFar;
2628 const qsizetype halfResultSize = resultSize >> 1;
2629 while (sizeSoFar <= halfResultSize) {
2630 memcpy(
end,
result.d.data(), sizeSoFar);
2634 memcpy(
end,
result.d.data(), resultSize - sizeSoFar);
2635 result.d.data()[resultSize] =
'\0';
2636 result.d.size = resultSize;
2641 if (ol_minus_1 < sizeof(std::size_t) * CHAR_BIT) \
2642 hashHaystack -= std::size_t(a) << ol_minus_1; \
2649 if (from < haystack.size()) {
2650 const char *
const b = haystack.data();
2651 if (
const auto n =
static_cast<const char *
>(
2652 memchr(
b + from, needle,
static_cast<size_t>(haystack.size() - from)))) {
2661 const auto ol = needle.size();
2662 const auto l = haystack.size();
2665 return qMax(from + l, 0);
2667 return from > l ? -1 : from;
2673 if (from > l || ol + from > l)
2676 return qFindByteArray(haystack.data(), haystack.size(), from, needle.data(), ol);
2713 auto delta = l - ol;
2716 if (from < 0 || from > l)
2721 const char *
end = haystack;
2723 const auto ol_minus_1 = std::size_t(ol - 1);
2724 const char *
n = needle + ol_minus_1;
2725 const char *
h = haystack + ol_minus_1;
2726 std::size_t hashNeedle = 0, hashHaystack = 0;
2728 for (idx = 0; idx < ol; ++idx) {
2729 hashNeedle = ((hashNeedle<<1) + *(
n-idx));
2730 hashHaystack = ((hashHaystack<<1) + *(
h-idx));
2732 hashHaystack -= *haystack;
2733 while (haystack >=
end) {
2734 hashHaystack += *haystack;
2735 if (hashHaystack == hashNeedle && memcmp(needle, haystack, ol) == 0)
2736 return haystack -
end;
2738 REHASH(*(haystack + ol));
2746 if (haystack.size() == 0)
2749 from += haystack.size();
2750 else if (from > haystack.size())
2751 from = haystack.size() - 1;
2753 const char *
b = haystack.data();
2754 const char *
n =
b + from + 1;
2765 if (haystack.isEmpty()) {
2766 if (needle.isEmpty() && from == 0)
2770 const auto ol = needle.size();
2774 return lastIndexOfHelper(haystack.data(), haystack.size(), needle.data(), ol, from);
2837 for (
char ch : haystack) {
2846 if (needle.size() == 0)
2847 return haystack.size() + 1;
2849 if (needle.size() == 1)
2854 if (haystack.size() > 500 && needle.size() > 5) {
2856 while ((
i =
matcher.indexIn(haystack,
i + 1)) != -1)
2859 while ((
i = haystack.indexOf(needle,
i + 1)) != -1)
2887#if QT_DEPRECATED_SINCE(6, 4)
2910 if (haystack.size() < needle.size())
2912 if (haystack.data() == needle.data() || needle.size() == 0)
2914 return memcmp(haystack.data(), needle.data(), needle.size()) == 0;
2939 if (haystack.size() < needle.size())
2941 if (haystack.end() == needle.end() || needle.size() == 0)
2943 return memcmp(haystack.end() - needle.size(), needle.data(), needle.size()) == 0;
2972 return c >=
'A' &&
c <=
'Z';
2980 return c >=
'a' &&
c <=
'z';
3089 switch (QContainerImplHelper::mid(
size(), &
p, &l)) {
3090 case QContainerImplHelper::Null:
3092 case QContainerImplHelper::Empty:
3096 case QContainerImplHelper::Full:
3098 case QContainerImplHelper::Subset:
3185template <
typename T>
3190 const char *firstBad = orig_begin;
3191 const char *
e =
input.constEnd();
3192 for ( ; firstBad !=
e ; ++firstBad) {
3195 if (
ch != converted)
3200 return std::move(
input);
3204 char *
b =
s.begin();
3205 char *
p =
b + (firstBad - orig_begin);
3207 for ( ;
p !=
e; ++
p)
3256#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
3288 if (
len == 0xffffffff) {
3293 const quint32 Step = 1024 * 1024;
3305 }
while (allocated <
len);
3661 auto stop =
view.end();
3742#if defined(QT_CHECK_RANGE)
3743 if (
base != 0 && (base < 2 || base > 36)) {
3744 qWarning(
"QByteArray::toIntegral: Invalid base %d",
base);
3760#if defined(QT_CHECK_RANGE)
3761 if (
base != 0 && (base < 2 || base > 36)) {
3762 qWarning(
"QByteArray::toIntegral: Invalid base %d",
base);
4115 const char alphabet_base64[] =
"ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef"
4116 "ghijklmn" "opqrstuv" "wxyz0123" "456789+/";
4117 const char alphabet_base64url[] =
"ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef"
4118 "ghijklmn" "opqrstuv" "wxyz0123" "456789-_";
4119 const char *
const alphabet = options &
Base64UrlEncoding ? alphabet_base64url : alphabet_base64;
4120 const char padchar =
'=';
4143 int j = (chunk & 0x00fc0000) >> 18;
4144 int k = (chunk & 0x0003f000) >> 12;
4145 int l = (chunk & 0x00000fc0) >> 6;
4146 int m = (chunk & 0x0000003f);
4147 *
out++ = alphabet[
j];
4148 *
out++ = alphabet[k];
4154 *
out++ = alphabet[l];
4160 *
out++ = alphabet[
m];
4226#if defined(QT_CHECK_RANGE)
4227 if (base < 2 || base > 36) {
4232 const char b =
'a' - 10;
4236 *--
p =
c + (
c < 10 ?
'0' :
b);
4249 const int buffsize = 66;
4250 char buff[buffsize];
4274 const int buffsize = 66;
4275 char buff[buffsize];
4423#if defined(QT_CHECK_RANGE)
4424 qWarning(
"QByteArray::setNum: Invalid format char '%c'",
format);
4492struct fromBase64_helper_result {
4497fromBase64_helper_result fromBase64_helper(
const char *
input,
qsizetype inputSize,
4499 QByteArray::Base64Options options)
4503 unsigned int buf = 0;
4511 if (
ch >=
'A' &&
ch <=
'Z') {
4513 }
else if (
ch >=
'a' &&
ch <=
'z') {
4515 }
else if (
ch >=
'0' &&
ch <=
'9') {
4530 if ((inputSize % 4) != 0) {
4533 }
else if ((
i == inputSize - 1) ||
4534 (
i == inputSize - 2 &&
input[++
i] ==
'=')) {
4556 buf &= (1 << nbits) - 1;
4597 if (base64.isDetached()) {
4598 const auto base64result = fromBase64_helper(base64.data(),
4602 base64.truncate(base64result.decodedLength);
4603 return { std::move(base64), base64result.status };
4612 const auto base64Size = base64.
size();
4614 const auto base64result = fromBase64_helper(base64.
data(),
4616 const_cast<char *
>(
result.constData()),
4618 result.truncate(base64result.decodedLength);
4619 return { std::move(
result), base64result.status };
4649 return std::move(
result.decoded);
4669 bool odd_digit =
true;
4710 char *hexData =
hex.data();
4716 if ((separator) && (
o <
length))
4717 hexData[
o++] = separator;
4728 const char *inputPtr =
data;
4737 if (
c == percent &&
i + 2 <
len) {
4741 if (
a >=
'0' &&
a <=
'9')
a -=
'0';
4742 else if (
a >=
'a' &&
a <=
'f')
a =
a -
'a' + 10;
4743 else if (
a >=
'A' &&
a <=
'F')
a =
a -
'A' + 10;
4745 if (
b >=
'0' &&
b <=
'9')
b -=
'0';
4746 else if (
b >=
'a' &&
b <=
'f')
b =
b -
'a' + 10;
4747 else if (
b >=
'A' &&
b <=
'F')
b =
b -
'A' + 10;
4749 *
data++ = (char)((
a << 4) |
b);
4835 return std::string(
data(),
size_t(
size()));
4872 return view.size() > 0 && memchr(
view.data(),
c,
view.size()) !=
nullptr;
4879 for (
unsigned char c : *
this) {
4880 if (
char(
c) != percent
4881 && ((
c >= 0x61 &&
c <= 0x7A)
4882 || (
c >= 0x41 &&
c <= 0x5A)
4883 || (
c >= 0x30 &&
c <= 0x39)
4910#if defined(Q_OS_WASM) || defined(Q_QDOC)
4935QByteArray QByteArray::fromEcmaUint8Array(emscripten::val uint8array)
4957emscripten::val QByteArray::toEcmaUint8Array()
5060#if QT_DEPRECATED_SINCE(6, 8)
constexpr bool isNull() const noexcept
constexpr qsizetype size() const noexcept
qsizetype lastIndexOf(QByteArrayView a) const noexcept
constexpr const_pointer data() const noexcept
qsizetype indexOf(QByteArrayView a, qsizetype from=0) const noexcept
double toDouble(bool *ok=nullptr) const
size_t qHash(const QByteArray::FromBase64Result &key, size_t seed) noexcept
Returns the hash value for key, using seed to seed the calculation.
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qulonglong toULongLong(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an {unsigned long long} using base base, which is ten by default.
qlonglong toLongLong(bool *ok=nullptr, int base=10) const
Returns the byte array converted to a {long long} using base base, which is ten by default.
char * iterator
This typedef provides an STL-style non-const iterator for QByteArray.
char * qstrncpy(char *dst, const char *src, size_t len)
A safe strncpy() function.
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first byte in the byte-ar...
QByteArray & prepend(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
size_t qstrlen(const char *str)
A safe strlen() function.
QByteArray repeated(qsizetype times) const
QDataStream & operator<<(QDataStream &out, const QByteArray &ba)
Writes byte array ba to the stream out and returns a reference to the stream.
QDataStream & operator>>(QDataStream &in, QByteArray &ba)
Reads a byte array into ba from the stream in and returns a reference to the stream.
QByteArray & operator=(const QByteArray &) noexcept
Assigns other to this byte array and returns a reference to this byte array.
uint toUInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an {unsigned int} using base base, which is ten by default.
QByteArray & fill(char c, qsizetype size=-1)
Sets every byte in the byte array to ch.
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
quint16 qChecksum(QByteArrayView data, Qt::ChecksumType standard)
static QByteArray fromHex(const QByteArray &hexEncoded)
Returns a decoded copy of the hex encoded array hexEncoded.
std::string toStdString() const
QByteArray last(qsizetype n) const
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QByteArray & setNum(short, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
bool isLower() const
Returns true if this byte array is lowercase, that is, if it's identical to its toLower() folding.
friend qsizetype erase(QByteArray &ba, const T &t)
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
int qstricmp(const char *str1, const char *str2)
A safe stricmp() function.
static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent='%')
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void chop(qsizetype n)
Removes n bytes from the end of the byte array.
qsizetype length() const noexcept
Same as size().
bool isUpper() const
Returns true if this byte array is uppercase, that is, if it's identical to its toUpper() folding.
static QByteArray fromStdString(const std::string &s)
ushort toUShort(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an {unsigned short} using base base, which is ten by default.
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last byte in the byte-...
const char * const_iterator
This typedef provides an STL-style const iterator for QByteArray.
long toLong(bool *ok=nullptr, int base=10) const
void truncate(qsizetype pos)
Truncates the byte array at index position pos.
double toDouble(bool *ok=nullptr) const
Returns the byte array converted to a double value.
QByteArray percentDecoded(char percent='%') const
static QByteArray fromBase64(const QByteArray &base64, Base64Options options=Base64Encoding)
@ AbortOnBase64DecodingErrors
QByteArray right(qsizetype len) const
Returns a byte array that contains the last len bytes of this byte array.
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
QByteArray toPercentEncoding(const QByteArray &exclude=QByteArray(), const QByteArray &include=QByteArray(), char percent='%') const
int qstrnicmp(const char *str1, const char *str2, size_t len)
A safe strnicmp() function.
void swap(QByteArray &other) noexcept
QByteArray & insert(qsizetype i, QByteArrayView data)
bool contains(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
constexpr QByteArray() noexcept
Constructs an empty byte array.
short toShort(bool *ok=nullptr, int base=10) const
Returns the byte array converted to a short using base base, which is ten by default.
const_iterator cbegin() const noexcept
ulong toULong(bool *ok=nullptr, int base=10) const
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
float toFloat(bool *ok=nullptr) const
Returns the byte array converted to a float value.
char * qstrcpy(char *dst, const char *src)
Copies all the characters up to and including the '\0' from src into dst and returns a pointer to dst...
QByteArray leftJustified(qsizetype width, char fill=' ', bool truncate=false) const
Returns a byte array of size width that contains this byte array padded with the fill byte.
QByteArrayData DataPointer
void clear()
Clears the contents of the byte array and makes it null.
int qstrcmp(const char *str1, const char *str2)
A safe strcmp() function.
QByteArray left(qsizetype len) const
Returns a byte array that contains the first len bytes of this byte array.
QByteArray rightJustified(qsizetype width, char fill=' ', bool truncate=false) const
Returns a byte array of size width that contains the fill byte followed by this byte array.
qsizetype lastIndexOf(char c, qsizetype from=-1) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first byte in the byte-array.
qsizetype capacity() const
Returns the maximum number of bytes that can be stored in the byte array without forcing a reallocati...
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray & remove(qsizetype index, qsizetype len)
Removes len bytes from the array, starting at index position pos, and returns a reference to the arra...
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toBase64(Base64Options options=Base64Encoding) const
char * qstrdup(const char *src)
Returns a duplicate string.
qsizetype count(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray & setRawData(const char *a, qsizetype n)
QByteArray toHex(char separator='\0') const
Returns a hex encoded copy of the byte array.
bool isNull() const noexcept
Returns true if this byte array is null; otherwise returns false.
QByteArray mid(qsizetype index, qsizetype len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos.
static FromBase64Result fromBase64Encoding(QByteArray &&base64, Base64Options options=Base64Encoding)
QByteArray & assign(QByteArrayView v)
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
QByteArray & replace(qsizetype index, qsizetype len, const char *s, qsizetype alen)
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore\reentrant
void append(parameter_type t)
QChar * data()
Returns a pointer to the data stored in the QString.
QByteArray copyToQByteArray() const
static Uint8Array copyFrom(const char *buffer, uint32_t size)
Combined button and popup list for selecting options.
constexpr int caseCompareAscii(char lhs, char rhs) noexcept
constexpr char toHexUpper(char32_t value) noexcept
constexpr char toHexLower(char32_t value) noexcept
constexpr int fromHex(char32_t c) noexcept
constexpr char toAsciiLower(char ch) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION ParsedNumber< qulonglong > toUnsignedInteger(QByteArrayView data, int base)
static constexpr bool q_points_into_range(const T *p, const T *b, const T *e, Cmp less={}) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QByteArrayView trimmed(QByteArrayView s) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION ParsedNumber< qlonglong > toSignedInteger(QByteArrayView data, int base)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QByteArrayView haystack, qsizetype from, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype count(QByteArrayView haystack, QByteArrayView needle) noexcept
Q_CORE_EXPORT int compareMemory(QByteArrayView lhs, QByteArrayView rhs)
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION ParsedNumber< float > toFloat(QByteArrayView a) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findByteArray(QByteArrayView haystack, qsizetype from, QByteArrayView needle) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION ParsedNumber< double > toDouble(QByteArrayView a) noexcept
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isValidUtf8(QByteArrayView s) noexcept
constexpr Initialization Uninitialized
QT_POPCOUNT_RELAXED_CONSTEXPR uint qCountLeadingZeroBits(quint32 v) noexcept
constexpr uint qCountTrailingZeroBits(quint32 v) noexcept
static jboolean copy(JNIEnv *, jobject)
static constexpr bool isLowerCaseAscii(char c)
static char * qulltoa2(char *p, qulonglong n, int base)
QByteArray qCompress(const uchar *data, qsizetype nbytes, int compressionLevel)
static Q_DECL_COLD_FUNCTION QByteArray tooMuchData(ZLibOp op)
static Q_DECL_COLD_FUNCTION QByteArray lengthIsNegative(ZLibOp op)
static Q_DECL_COLD_FUNCTION QByteArray invalidCompressedData()
static qsizetype lastIndexOfCharHelper(QByteArrayView haystack, qsizetype from, char needle) noexcept
static Q_DECL_COLD_FUNCTION const char * zlibOpAsString(ZLibOp op)
static qsizetype findCharHelper(QByteArrayView haystack, qsizetype from, char needle) noexcept
static QByteArray toCase_template(T &input, uchar(*lookup)(uchar))
static Q_DECL_COLD_FUNCTION QByteArray zlibError(ZLibOp op, const char *what)
static void q_fromPercentEncoding(QByteArray *ba, char percent)
int qstrnicmp(const char *str1, qsizetype len1, const char *str2, qsizetype len2)
static qsizetype lastIndexOfHelper(const char *haystack, qsizetype l, const char *needle, qsizetype ol, qsizetype from)
static Q_DECL_COLD_FUNCTION QByteArray dataIsNull(ZLibOp op)
static constexpr bool isUpperCaseAscii(char c)
static const quint16 crc_tbl[16]
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)
qsizetype qFindByteArray(const char *haystack0, qsizetype haystackLen, qsizetype from, const char *needle0, qsizetype needleLen)
quint32 CompressSizeHint_t
static constexpr uchar asciiLower(uchar c)
static qsizetype countCharHelper(QByteArrayView haystack, char needle) noexcept
static Q_DECL_COLD_FUNCTION QByteArray unexpectedZlibError(ZLibOp op, int err, const char *msg)
static constexpr uchar asciiUpper(uchar c)
Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, qsizetype nbytes)
QT_BEGIN_NAMESPACE constexpr qsizetype MaxByteArraySize
Q_CORE_EXPORT char * qstrcpy(char *dst, const char *src)
QByteArrayView qToByteArrayViewIgnoringNull(const QByteArrayLike &b) noexcept
#define Q_DECL_COLD_FUNCTION
constexpr T qToBigEndian(T source)
constexpr QtPrivate::QHashMultiReturnType< T... > qHashMulti(size_t seed, const T &... args) noexcept(std::conjunction_v< QtPrivate::QNothrowHashable< T >... >)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLfloat GLfloat GLfloat v2
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLfloat GLfloat GLfloat GLfloat v3
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLsizei GLenum const void * indices
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLenum input
GLenum GLint GLint * precision
static constexpr qint64 HeaderSize
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
static constexpr QChar sep
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
static double toDouble(Value v)
QT_BEGIN_NAMESPACE typedef uchar * output
static int inflate(Bytef *dest, ulong *destLen, const Bytef *source, ulong sourceLen)
static int deflate(Bytef *dest, ulong *destLen, const Bytef *source, ulong sourceLen)
Q_CHECK_PTR(a=new int[80])
QTextStream out(stdout)
[7]
static const auto matcher
[0]
void detachAndGrow(QArrayData::GrowthPosition where, qsizetype n, const T **data, QArrayDataPointer *old)
bool isShared() const noexcept
qsizetype freeSpaceAtBegin() const noexcept
bool needsDetach() const noexcept
qsizetype allocatedCapacity() noexcept
void setBegin(T *begin) noexcept
qsizetype freeSpaceAtEnd() const noexcept
qsizetype constAllocatedCapacity() const noexcept
void clear() noexcept(std::is_nothrow_destructible< T >::value)
static QArrayDataPointer allocateGrow(const QArrayDataPointer &from, qsizetype n, QArrayData::GrowthPosition position)
bool isMutable() const noexcept
static Q_NODISCARD_CTOR QArrayDataPointer fromRawData(const T *rawData, qsizetype length) noexcept
static quint64 bytearrayToUnsLongLong(QByteArrayView num, int base, bool *ok)
static float convertDoubleToFloat(double d, bool *ok)
static Q_CORE_EXPORT qint64 bytearrayToLongLong(QByteArrayView num, int base, bool *ok)
static StringType trimmed_helper(StringType &str)
static void trimmed_helper_positions(const Char *&begin, const Char *&end)
static StringType simplified_helper(StringType &str)
static QPair< QTypedArrayData *, T * > allocate(qsizetype capacity, AllocationOption option=QArrayData::KeepSize)
static ValidUtf8Result isValidUtf8(QByteArrayView in)
void copyAppend(const T *b, const T *e)
void erase(T *b, qsizetype n)
void insert(qsizetype i, const T *data, qsizetype n)