4#ifndef QVARLENGTHARRAY_H
5#define QVARLENGTHARRAY_H
8#pragma qt_class(QVarLengthArray)
9#pragma qt_sync_stop_processing
12#include <QtCore/qcompare.h>
13#include <QtCore/qcontainerfwd.h>
14#include <QtCore/qglobal.h>
15#include <QtCore/qalgorithms.h>
16#include <QtCore/qcontainertools_impl.h>
17#include <QtCore/qhashfunctions.h>
18#include <QtCore/qttypetraits.h>
21#include <initializer_list>
23#include <QtCore/q20memory.h>
31template <size_t Size, size_t Align, qsizetype Prealloc>
34 template <size_t>
class print;
36 QVLAStorage() =
default;
37 QT_DECLARE_RO5_SMF_AS_DEFAULTED(QVLAStorage)
39 alignas(Align)
char array[Prealloc * (Align > Size ? Align : Size)];
41 QT_WARNING_DISABLE_DEPRECATED
44 static_assert(std::is_same_v<print<
sizeof(std::aligned_storage_t<Size, Align>[Prealloc])>,
45 print<
sizeof(array)>>);
63 Q_ASSERT(pos <= size());
65 Q_ASSERT(n <= size() - pos);
69 void operator()(
void *p)
const noexcept { free(p); }
78 constexpr bool empty()
const noexcept {
return size() == 0; }
89 T *
data()
noexcept {
return static_cast<
T *>(
ptr); }
90 const T *
data()
const noexcept {
return static_cast<
T *>(
ptr); }
93 using const_iterator =
const T*;
96 const_iterator
begin()
const noexcept {
return data(); }
99 const_iterator
end()
const noexcept {
return data() + size(); }
103 using const_reverse_iterator =
std::reverse_iterator<const_iterator>;
106 const_reverse_iterator
rbegin()
const noexcept {
return const_reverse_iterator{
end()}; }
109 const_reverse_iterator
rend()
const noexcept {
return const_reverse_iterator{
begin()}; }
112 using value_type = T;
113 using reference = value_type&;
114 using const_reference =
const value_type&;
115 using pointer = value_type*;
116 using const_pointer =
const value_type*;
146 if constexpr (QTypeInfo<T>::isComplex)
147 data()[size() - 1].~T();
151 template <
typename AT = T>
153 template <
typename AT = T>
155 template <
typename AT = T>
169 value_type
value(qsizetype i)
const;
170 value_type
value(qsizetype i,
const T& defaultValue)
const;
173 void remove(qsizetype i, qsizetype n = 1);
174 template <
typename AT = T>
176 template <
typename AT = T>
178 template <
typename Predicate>
183 if constexpr (QTypeInfo<T>::isComplex)
184 std::destroy_n(data(), size());
194 return (QtPrivate::MaxAllocSize /
sizeof(T)) - 1;
206 void growBy(qsizetype prealloc,
void *array, qsizetype increment)
207 { reallocate_impl(prealloc, array, size(), (std::max)(size() * 2, size() + increment)); }
208 template <
typename...Args>
211 if (size() == capacity())
212 growBy(prealloc, array, 1);
213 reference r = *q20::construct_at(end(), std::forward<Args>(args)...);
217 template <
typename...Args>
222 template <
typename S>
227 template <
typename S>
230 return std::lexicographical_compare(
begin(),
end(), other.begin(), other.end());
233 void append_impl(qsizetype prealloc,
void *array,
const T *buf, qsizetype n);
234 void reallocate_impl(qsizetype prealloc,
void *array, qsizetype size, qsizetype alloc);
235 void resize_impl(qsizetype prealloc,
void *array, qsizetype sz,
const T &v)
237 if (QtPrivate::q_points_into_range(&v, begin(), end())) {
238 resize_impl(prealloc, array, sz, T(v));
241 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
242 while (size() < sz) {
243 q20::construct_at(data() + size(), v);
249 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
250 if constexpr (QTypeInfo<T>::isComplex) {
252 while (size() < sz) {
253 q20::construct_at(data() + size());
261 void assign_impl(qsizetype prealloc,
void *array, qsizetype n,
const T &t);
262 template <
typename Iterator>
263 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last);
267 const std::less<
const T *> less = {};
273template<
class T, qsizetype Prealloc>
275#if QT_VERSION >= QT_VERSION_CHECK(7
,0
,0
) || defined(QT_BOOTSTRAPPED)
283 template <
class S, qsizetype Prealloc2>
287 static_assert(Prealloc > 0,
"QVarLengthArray Prealloc must be greater than 0.");
288 static_assert(
std::is_nothrow_destructible_v<T>,
"Types with throwing destructors are not supported in Qt containers.");
291 template <
typename U>
298 using size_type =
typename Base::size_type;
299 using value_type =
typename Base::value_type;
300 using pointer =
typename Base::pointer;
301 using const_pointer =
typename Base::const_pointer;
302 using reference =
typename Base::reference;
303 using const_reference =
typename Base::const_reference;
304 using difference_type =
typename Base::difference_type;
306 using iterator =
typename Base::iterator;
307 using const_iterator =
typename Base::const_iterator;
308 using reverse_iterator =
typename Base::reverse_iterator;
309 using const_reverse_iterator =
typename Base::const_reverse_iterator;
315 this->ptr =
this->array;
321 template <
typename U = T, if_copyable<U> =
true>
339 const auto otherInlineStorage =
reinterpret_cast<T*>(other.array);
340 if (data() == otherInlineStorage) {
342 this->ptr =
this->array;
343 QtPrivate::q_uninitialized_relocate_n(otherInlineStorage, size(), data());
350 other.ptr = otherInlineStorage;
358 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
362 QtPrivate::reserveIfForwardIterator(
this, first, last);
363 std::copy(first, last,
std::back_inserter(*
this));
368 if constexpr (QTypeInfo<T>::isComplex)
369 std::destroy_n(data(), size());
370 if (data() !=
reinterpret_cast<T *>(
this->array))
375 if (
this != &other) {
389 Q_ASSERT(capacity() >= Prealloc);
390 const auto otherInlineStorage = other.array;
391 if (other.ptr != otherInlineStorage) {
393 this->a =
std::exchange(other.a, Prealloc);
394 this->ptr =
std::exchange(other.ptr, otherInlineStorage);
397 QtPrivate::q_uninitialized_relocate_n(other.data(), other.size(), data());
399 this->s =
std::exchange(other.s, 0);
419 using Base::max_size;
439 void resize(qsizetype sz) { Base::resize_impl(Prealloc,
this->array, sz); }
441 template <
typename U = T, if_copyable<U> =
true>
444 { Base::resize_impl(Prealloc,
this->array, sz, v); }
449 void squeeze() { reallocate(size(), size()); }
451 using Base::capacity;
455 void reserve(qsizetype sz) {
if (sz > capacity()) reallocate(size(), sz); }
458 template <
typename AT =
T>
460 template <
typename AT =
T>
462 template <
typename AT =
T>
466 using Base::lastIndexOf;
467 using Base::contains;
481 using Base::operator[];
482 inline const T &
at(qsizetype idx)
const {
return operator[](idx); }
492 if (size() == capacity())
500 emplace_back(
std::move(t));
504 { Base::append_impl(Prealloc,
this->array, buf, sz); }
506 { append(t);
return *
this; }
508 { append(
std::move(t));
return *
this; }
510 { append(t);
return *
this; }
512 { append(
std::move(t));
return *
this; }
514#if QT_DEPRECATED_SINCE(6
, 3
)
522 void insert(qsizetype i, qsizetype n,
const T &t);
525 { Base::assign_impl(Prealloc,
this->array, n, t);
return *
this; }
526 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
528 { Base::assign_impl(Prealloc,
this->array, first, last);
return *
this; }
530 { assign(list.begin(), list.end());
return *
this; }
535 template <
typename AT =
T>
537 template <
typename AT =
T>
544 using Base::removeAll;
545 using Base::removeOne;
546 using Base::removeIf;
549 inline T *
data() {
return this->
ptr; }
550 inline const T *
data()
const {
return this->
ptr; }
566 auto constBegin()
const -> const_iterator {
return begin(); }
569 inline const_iterator
constEnd()
const {
return end(); }
583 iterator
insert(const_iterator before, qsizetype n,
const T &x)
584 {
return Base::insert_impl(Prealloc,
this->array, before, n, x); }
585 iterator
insert(const_iterator before, T &&x) {
return emplace(before,
std::move(x)); }
586 inline iterator
insert(const_iterator before,
const T &x) {
return insert(before, 1, x); }
605 inline const T &
back()
const {
return last(); }
607 using Base::pop_back;
611 template <
typename...Args>
612 iterator
emplace(const_iterator pos, Args &&...args)
613 {
return Base::emplace_impl(Prealloc,
this->array, pos,
std::forward<Args>(args)...); }
614 template <
typename...Args>
616 {
return Base::emplace_back_impl(Prealloc,
this->array,
std::forward<Args>(args)...); }
636 template <
typename U = T, qsizetype Prealloc2 = Prealloc,
637 Qt::if_has_qt_compare_three_way<U, U> =
true>
641 return QtOrderingPrivate::lexicographicalCompareThreeWay(lhs.begin(), lhs.end(),
642 rhs.begin(), rhs.end());
645#if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts)
658 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
664 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
670#ifndef __cpp_lib_three_way_comparison
671 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
676 return lhs.less_than(rhs);
679 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
681 noexcept(
noexcept(
lhs <
rhs))
686 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
688 noexcept(
noexcept(
lhs <
rhs))
693 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
695 noexcept(
noexcept(
lhs <
rhs))
703 template <
typename U, qsizetype Prealloc2>
705 {
return Base::equal(other); }
706 template <
typename U, qsizetype Prealloc2>
708 {
return Base::less_than(other); }
710 void reallocate(qsizetype sz, qsizetype alloc)
711 { Base::reallocate_impl(Prealloc,
this->array, sz, alloc); }
713 using Base::isValidIterator;
716template <
typename InputIterator,
717 typename ValueType =
typename std::iterator_traits<InputIterator>::value_type,
718 QtPrivate::IfIsInputIterator<InputIterator> =
true>
719QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>;
721template <
class T, qsizetype Prealloc>
722Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(qsizetype asize)
725 Q_ASSERT_X(asize >= 0,
"QVarLengthArray::QVarLengthArray(qsizetype)",
726 "Size must be greater than or equal to 0.");
731 if (asize > Prealloc) {
732 this->ptr = malloc(asize *
sizeof(T));
733 Q_CHECK_PTR(
this->ptr);
736 if constexpr (QTypeInfo<T>::isComplex)
737 std::uninitialized_default_construct_n(data(), asize);
742template <
typename AT>
743Q_INLINE_TEMPLATE qsizetype QVLABase<T>::indexOf(
const AT &t, qsizetype from)
const
746 from = qMax(from + size(), qsizetype(0));
748 const T *n = data() + from - 1;
758template <
typename AT>
759Q_INLINE_TEMPLATE qsizetype QVLABase<T>::lastIndexOf(
const AT &t, qsizetype from)
const
763 else if (from >= size())
766 const T *b = begin();
767 const T *n = b + from + 1;
777template <
typename AT>
792 Q_ASSERT(abuf || increment == 0);
796 const qsizetype asize = size() + increment;
798 if (asize >= capacity())
799 growBy(prealloc, array, increment);
801 if constexpr (QTypeInfo<T>::isComplex)
802 std::uninitialized_copy_n(abuf, increment,
end());
804 memcpy(
static_cast<
void *>(
end()),
static_cast<
const void *>(abuf), increment *
sizeof(T));
813 if (n > capacity()) {
814 reallocate_impl(prealloc, array, 0, capacity());
815 resize_impl(prealloc, array, n, t);
817 auto mid = (std::min)(n, size());
818 std::fill(data(), data() + mid, t);
819 std::uninitialized_fill(data() + mid, data() + n, t);
821 erase(data() + n, data() + size());
826template <
typename Iterator>
830 constexpr bool IsFwdIt =
831 std::is_convertible_v<
typename std::iterator_traits<Iterator>::iterator_category,
832 std::forward_iterator_tag>;
833 if constexpr (IsFwdIt) {
834 const qsizetype n =
std::distance(first, last);
836 reallocate_impl(prealloc, array, 0, n);
840 const auto dend =
end();
843 std::destroy(dst, dend);
847 if constexpr (IsFwdIt) {
848 dst =
std::uninitialized_copy(first, last, dst);
852 emplace_back_impl(prealloc, array, *first);
853 }
while (++first != last);
867 Q_ASSERT(aalloc >= asize);
870 qsizetype osize = size();
872 const qsizetype copySize = qMin(asize, osize);
873 Q_ASSERT(copySize >= 0);
875 if (aalloc != capacity()) {
879 if (aalloc > prealloc) {
880 newPtr = malloc(aalloc *
sizeof(T));
889 QtPrivate::q_uninitialized_relocate_n(oldPtr, copySize,
890 reinterpret_cast<T *>(newPtr));
899 if constexpr (QTypeInfo<T>::isComplex) {
901 std::destroy(oldPtr + asize, oldPtr + osize);
904 if (oldPtr !=
reinterpret_cast<T *>(array) && oldPtr != data())
909Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i)
const
911 if (size_t(i) >= size_t(size()))
913 return operator[](i);
916Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i,
const T &defaultValue)
const
918 return (size_t(i) >= size_t(size())) ? defaultValue : operator[](i);
921template <
class T, qsizetype Prealloc>
924 insert(cbegin() + i,
std::move(t)); }
925template <
class T, qsizetype Prealloc>
928 insert(begin() + i, 1, t); }
929template <
class T, qsizetype Prealloc>
932 insert(begin() + i, n, t); }
936 erase(begin() + i, begin() + i + n); }
938template <
typename AT>
940{
return QtPrivate::sequential_erase_with_copy(*
this, t); }
942template <
typename AT>
944{
return QtPrivate::sequential_erase_one(*
this, t); }
946template <
typename Predicate>
948{
return QtPrivate::sequential_erase_if(*
this, pred); }
949#if QT_DEPRECATED_SINCE(6
, 3
)
950template <
class T, qsizetype Prealloc>
951inline void QVarLengthArray<T, Prealloc>::prepend(T &&t)
952{ insert(cbegin(), std::move(t)); }
953template <
class T, qsizetype Prealloc>
954inline void QVarLengthArray<T, Prealloc>::prepend(
const T &t)
955{ insert(begin(), 1, t); }
966template <
typename...Args>
969 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
970 Q_ASSERT(size() <= capacity());
971 Q_ASSERT(capacity() > 0);
973 const qsizetype offset = qsizetype(before -
cbegin());
974 emplace_back_impl(prealloc, array,
std::forward<Args>(args)...);
975 const auto b =
begin() + offset;
976 const auto e =
end();
977 QtPrivate::q_rotate(b, e - 1, e);
984 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
986 const qsizetype offset = qsizetype(before -
cbegin());
987 resize_impl(prealloc, array, size() + n, t);
988 const auto b =
begin() + offset;
989 const auto e =
end();
990 QtPrivate::q_rotate(b, e - n, e);
997 Q_ASSERT_X(
isValidIterator(abegin
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'abegin' is invalid");
998 Q_ASSERT_X(
isValidIterator(aend
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'aend' is invalid");
1000 qsizetype f = qsizetype(abegin - cbegin());
1001 qsizetype l = qsizetype(aend - cbegin());
1002 qsizetype n = l - f;
1009 if constexpr (!QTypeInfo<T>::isRelocatable) {
1010 std::move(begin() + l, end(), QT_MAKE_CHECKED_ARRAY_ITERATOR(begin() + f, size() - f));
1011 std::destroy(end() - n, end());
1013 std::destroy(abegin, aend);
1014 memmove(
static_cast<
void *>(data() + f),
static_cast<
const void *>(data() + l), (size() - l) *
sizeof(T));
1022template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1023bool operator==(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1025template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1026bool operator!=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1028template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1029bool operator< (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1031template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1032bool operator> (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1034template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1035bool operator<=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1037template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1038bool operator>=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1042template <
typename T, qsizetype Prealloc>
1046 return key.hash(seed);
1049template <
typename T, qsizetype Prealloc,
typename AT>
1052 return array.removeAll(t);
1055template <
typename T, qsizetype Prealloc,
typename Predicate>
1058 return array.removeIf(pred);
QByteArray & operator*() noexcept
QByteArray::Base64DecodingStatus decodingStatus
friend bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are equal, otherwise returns false.
void swap(QByteArray::FromBase64Result &other) noexcept
operator bool() const noexcept
\variable QByteArray::FromBase64Result::decoded
const QByteArray & operator*() const noexcept
Returns the decoded byte array.
friend bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are different, otherwise returns false.
\inmodule QtCore\reentrant
int initFrom(const QMessageLogContext &logContext)
void populateBacktrace(int frameCount)
QInternalMessageLogContext(const QMessageLogContext &logContext, const QLoggingCategory &categoryOverride)
std::optional< BacktraceStorage > backtrace
static constexpr int DefaultBacktraceDepth
constexpr QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) noexcept
constexpr QMessageLogContext() noexcept=default
QDebug debug(CategoryFunction catFunc) const
QDebug debug(const QLoggingCategory &cat) const
Logs a debug message into category cat using a QDebug stream.
void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void QDebug debug() const
Logs a debug message using a QDebug stream.
QDebug info(const QLoggingCategory &cat) const
Logs an informational message into the category cat using a QDebug stream.
QDebug info() const
Logs an informational message using a QDebug stream.
QNoDebug noDebug(...) const noexcept
QDebug info(CategoryFunction catFunc) const
Mutex * mutex() const noexcept
Returns the mutex on which the QMutexLocker is operating.
void unlock() noexcept
Unlocks this mutex locker.
~QMutexLocker() noexcept
Destroys the QMutexLocker and unlocks the mutex that was locked in the constructor.
void relock() noexcept
Relocks an unlocked mutex locker.
constexpr size_type capacity() const noexcept
Q_ALWAYS_INLINE constexpr void verify(qsizetype pos=0, qsizetype n=1) const
constexpr bool empty() const noexcept
constexpr size_type size() const noexcept
value_type value(qsizetype i, const T &defaultValue) const
const_reverse_iterator rend() const noexcept
void remove(qsizetype i, qsizetype n=1)
void reallocate_impl(qsizetype prealloc, void *array, qsizetype size, qsizetype alloc)
const_reference operator[](qsizetype idx) const
value_type value(qsizetype i) const
const_reverse_iterator rbegin() const noexcept
reference emplace_back_impl(qsizetype prealloc, void *array, Args &&...args)
bool less_than(const QVLABase< S > &other) const
qsizetype removeIf(Predicate pred)
iterator erase(const_iterator pos)
const_reference back() const
reverse_iterator rbegin() noexcept
const_iterator cbegin() const noexcept
qsizetype lastIndexOf(const AT &t, qsizetype from=-1) const
void resize_impl(qsizetype prealloc, void *array, qsizetype sz, const T &v)
void growBy(qsizetype prealloc, void *array, qsizetype increment)
bool removeOne(const AT &t)
bool equal(const QVLABase< S > &other) const
iterator erase(const_iterator begin, const_iterator end)
const_reference front() const
bool isValidIterator(const const_iterator &i) const
const_iterator cend() const noexcept
static constexpr qsizetype maxSize() noexcept
const_reverse_iterator crbegin() const noexcept
void resize_impl(qsizetype prealloc, void *array, qsizetype sz)
void replace(qsizetype i, const T &t)
iterator insert_impl(qsizetype prealloc, void *array, const_iterator pos, qsizetype n, const T &t)
void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last)
reference operator[](qsizetype idx)
size_t hash(size_t seed) const noexcept(QtPrivate::QNothrowHashable_v< T >)
Q_OUTOFLINE_TEMPLATE void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last)
const_iterator end() const noexcept
qsizetype indexOf(const AT &t, qsizetype from=0) const
const_iterator begin() const noexcept
qsizetype removeAll(const AT &t)
Q_INLINE_TEMPLATE bool contains(const AT &t) const
void append_impl(qsizetype prealloc, void *array, const T *buf, qsizetype n)
const_reverse_iterator crend() const noexcept
bool contains(const AT &t) const
reverse_iterator rend() noexcept
constexpr qsizetype max_size() const noexcept
void assign_impl(qsizetype prealloc, void *array, qsizetype n, const T &t)
iterator begin() noexcept
iterator emplace_impl(qsizetype prealloc, void *array, const_iterator pos, Args &&...arg)
friend QTypeTraits::compare_lt_result< U > operator>(const QVarLengthArray< T, Prealloc > &lhs, const QVarLengthArray< T, Prealloc2 > &rhs) noexcept(noexcept(lhs< rhs))
QVarLengthArray & assign(InputIterator first, InputIterator last)
QVarLengthArray< T, Prealloc > & operator+=(const T &t)
iterator insert(const_iterator before, T &&x)
T & emplace_back(Args &&...args)
const T & at(qsizetype idx) const
void resize(qsizetype sz)
QVarLengthArray< T, Prealloc > & operator=(const QVarLengthArray< T, Prealloc > &other)
QVarLengthArray(qsizetype sz, const T &v)
QVarLengthArray(const QVarLengthArray &other)
QVarLengthArray(qsizetype size)
iterator insert(const_iterator before, qsizetype n, const T &x)
QVarLengthArray(InputIterator first, InputIterator last)
iterator emplace(const_iterator pos, Args &&...args)
void insert(qsizetype i, T &&t)
QVarLengthArray(QVarLengthArray &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
friend QTypeTraits::compare_lt_result< U > operator<=(const QVarLengthArray< T, Prealloc > &lhs, const QVarLengthArray< T, Prealloc2 > &rhs) noexcept(noexcept(lhs< rhs))
QVarLengthArray & operator=(QVarLengthArray &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
static constexpr qsizetype PreallocatedSize
friend QTypeTraits::compare_eq_result< U > operator==(const QVarLengthArray< T, Prealloc > &l, const QVarLengthArray< T, Prealloc2 > &r)
QVarLengthArray & assign(qsizetype n, const T &t)
QVarLengthArray< T, Prealloc > & operator+=(T &&t)
const_iterator constEnd() const
friend QTypeTraits::compare_eq_result< U > operator!=(const QVarLengthArray< T, Prealloc > &l, const QVarLengthArray< T, Prealloc2 > &r)
friend QTypeTraits::compare_lt_result< U > operator>=(const QVarLengthArray< T, Prealloc > &lhs, const QVarLengthArray< T, Prealloc2 > &rhs) noexcept(noexcept(lhs< rhs))
void resize(qsizetype sz, const T &v)
void append(const T *buf, qsizetype sz)
QVarLengthArray< T, Prealloc > & operator=(std::initializer_list< T > list)
friend auto compareThreeWay(const QVarLengthArray &lhs, const QVarLengthArray< T, Prealloc2 > &rhs)
QVarLengthArray(std::initializer_list< T > args)
iterator insert(const_iterator before, const T &x)
friend QTypeTraits::compare_lt_result< U > operator<(const QVarLengthArray< T, Prealloc > &lhs, const QVarLengthArray< T, Prealloc2 > &rhs) noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end())))
void insert(qsizetype i, const T &t)
const T * constData() const
void push_back(const T &t)
auto constBegin() const -> const_iterator
QVarLengthArray() noexcept
void reserve(qsizetype sz)
QVarLengthArray & assign(std::initializer_list< T > list)
void insert(qsizetype i, qsizetype n, const T &t)
static Q_CONSTINIT thread_local bool msgHandlerGrabbed
static const char ifCriticalTokenC[]
static const char emptyTokenC[]
static Q_NEVER_INLINE void qt_message(QtMsgType msgType, const QMessageLogContext &context, const char *msg, va_list ap)
static void preformattedMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &formattedMessage)
static bool systemHasStderr()
Returns true if writing to stderr is supported.
static const char endifTokenC[]
static bool isDefaultCategory(const char *category)
static const char messageTokenC[]
static constexpr SystemMessageSink systemMessageSink
static void qt_maybe_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message)
\inmodule QtCore \title Qt Logging Types
#define HANDLE_IF_TOKEN(LEVEL)
Q_DECLARE_TYPEINFO(QMessagePattern::BacktraceParams, Q_RELOCATABLE_TYPE)
static const char timeTokenC[]
static bool is_fatal_count_down(QAtomicInt &n)
static const char qthreadptrTokenC[]
static const char fileTokenC[]
static const char ifDebugTokenC[]
static const char ifFatalTokenC[]
static const char categoryTokenC[]
static const char lineTokenC[]
static const char typeTokenC[]
static const char ifCategoryTokenC[]
static int checked_var_value(const char *varname)
static const char pidTokenC[]
Q_TRACE_POINT(qtcore, qt_message_print, int type, const char *category, const char *function, const char *file, int line, const QString &message)
static const char threadidTokenC[]
static QString formatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &str)
static const char backtraceTokenC[]
static const char functionTokenC[]
static const char ifWarningTokenC[]
static const char appnameTokenC[]
static bool isFatal(QtMsgType msgType)
static const char ifInfoTokenC[]
static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message)
static bool stderrHasConsoleAttached()
Returns true if writing to stderr will end up in a console/terminal visible to the user.
Combined button and popup list for selecting options.
QDebug printAssociativeContainer(QDebug debug, const char *which, const AssociativeContainer &c)
bool shouldLogToStderr()
Returns true if logging stderr should be ensured.
QDebug printSequentialContainer(QDebug debug, const char *which, const SequentialContainer &c)
QByteArray operator""_ba(const char *str, size_t size) noexcept
QT_BEGIN_NAMESPACE Q_NORETURN void qAbort()
QByteArray operator+(const QByteArray &a1, const char *a2)
QByteArray qUncompress(const QByteArray &data)
QByteArray operator+(char a1, const QByteArray &a2)
QByteArray operator+(QByteArray &&lhs, char rhs)
QByteArray operator+(const QByteArray &a1, char a2)
QByteArray operator+(const char *a1, const QByteArray &a2)
QByteArray operator+(QByteArray &&lhs, const QByteArray &rhs)
qsizetype erase_if(QByteArray &ba, Predicate pred)
QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
QByteArray qCompress(const QByteArray &data, int compressionLevel=-1)
qsizetype erase(QByteArray &ba, const T &t)
QByteArray operator+(QByteArray &&lhs, const char *rhs)
#define __has_cpp_attribute(x)
void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, Int value)
Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, quint64 value)
Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, uint value)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
#define QT_MESSAGELOG_FUNC
Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(int code, const char *msg,...)
Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(const char *msg,...)
#define QT_MESSAGELOG_FILE
#define QT_MESSAGE_LOGGER_NORETURN
#define QT_MESSAGELOG_LINE
Q_CORE_EXPORT void qSetMessagePattern(const QString &messagePattern)
#define QT_MESSAGELOGCONTEXT
Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &context, const QString &message)
void(* QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &)
#define Q_LOGGING_CATEGORY(name,...)
#define QT_MESSAGE_LOGGER_COMMON(category, level)
#define Q_DECLARE_LOGGING_CATEGORY(name)
QScopeGuard(F(&)()) -> QScopeGuard< F(*)()>
qsizetype erase(QVarLengthArray< T, Prealloc > &array, const AT &t)
qsizetype erase_if(QVarLengthArray< T, Prealloc > &array, Predicate pred)
size_t qHash(const QVarLengthArray< T, Prealloc > &key, size_t seed=0) noexcept(QtPrivate::QNothrowHashable_v< T >)
QString backtraceSeparator
void setPattern(const QString &pattern)
std::unique_ptr< std::unique_ptr< const char[]>[]> literals
std::chrono::steady_clock::time_point appStartTime
std::unique_ptr< const char *[]> tokens
QList< QString > timeArgs
void operator()(void *p) const noexcept
static constexpr bool Value
static constexpr bool Value