4#ifndef QVARLENGTHARRAY_H
5#define QVARLENGTHARRAY_H
8#pragma qt_class(QVarLengthArray)
9#pragma qt_sync_stop_processing
12#include <QtCore/qalloc.h>
13#include <QtCore/qcompare.h>
14#include <QtCore/qcontainerfwd.h>
15#include <QtCore/qglobal.h>
16#include <QtCore/qalgorithms.h>
17#include <QtCore/qcontainertools_impl.h>
18#include <QtCore/qhashfunctions.h>
19#include <QtCore/qttypetraits.h>
22#include <initializer_list>
24#include <QtCore/q20memory.h>
32template <size_t Size, size_t Align, qsizetype Prealloc>
35 template <size_t>
class print;
37 QVLAStorage() =
default;
38 QT_DECLARE_RO5_SMF_AS_DEFAULTED(QVLAStorage)
40 alignas(Align)
char array[Prealloc * (Align > Size ? Align : Size)];
42 QT_WARNING_DISABLE_DEPRECATED
45 static_assert(std::is_same_v<print<
sizeof(std::aligned_storage_t<Size, Align>[Prealloc])>,
46 print<
sizeof(array)>>);
64 Q_ASSERT(pos <= size());
66 Q_ASSERT(n <= size() - pos);
70 void operator()(
void *p)
const noexcept { free(p); }
79 constexpr bool empty()
const noexcept {
return size() == 0; }
90 T *
data()
noexcept {
return static_cast<
T *>(
ptr); }
91 const T *
data()
const noexcept {
return static_cast<
T *>(
ptr); }
147 if constexpr (QTypeInfo<T>::isComplex)
148 data()[size() - 1].~T();
152 template <
typename AT = T>
154 template <
typename AT = T>
156 template <
typename AT = T>
174 void remove(qsizetype i, qsizetype n = 1);
175 template <
typename AT = T>
177 template <
typename AT = T>
179 template <
typename Predicate>
184 if constexpr (QTypeInfo<T>::isComplex)
185 std::destroy_n(data(), size());
195 return (QtPrivate::MaxAllocSize /
sizeof(T)) - 1;
207 void growBy(qsizetype prealloc,
void *array, qsizetype increment)
208 { reallocate_impl(prealloc, array, size(), (std::max)(size() * 2, size() + increment)); }
209 template <
typename...Args>
212 if (size() == capacity())
213 growBy(prealloc, array, 1);
214 reference r = *q20::construct_at(end(), std::forward<Args>(args)...);
218 template <
typename...Args>
223 template <
typename S>
228 template <
typename S>
231 return std::lexicographical_compare(
begin(),
end(), other.begin(), other.end());
234 void append_impl(qsizetype prealloc,
void *array,
const T *buf, qsizetype n);
235 void reallocate_impl(qsizetype prealloc,
void *array, qsizetype size, qsizetype alloc);
236 void resize_impl(qsizetype prealloc,
void *array, qsizetype sz,
const T &v)
238 if (QtPrivate::q_points_into_range(&v, begin(), end())) {
239 resize_impl(prealloc, array, sz, T(v));
242 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
243 while (size() < sz) {
244 q20::construct_at(data() + size(), v);
250 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
251 if constexpr (QTypeInfo<T>::isComplex) {
253 while (size() < sz) {
254 q20::construct_at(data() + size());
262 void assign_impl(qsizetype prealloc,
void *array, qsizetype n,
const T &t);
263 template <
typename Iterator>
264 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last,
265 std::forward_iterator_tag);
266 template <
typename Iterator>
267 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last,
268 std::input_iterator_tag);
269 template <
typename Iterator>
270 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last);
274 const std::less<
const T *> less = {};
280template<
class T, qsizetype Prealloc>
282#if QT_VERSION >= QT_VERSION_CHECK(7
,0
,0
) || defined(QT_BOOTSTRAPPED)
290 template <
class S, qsizetype Prealloc2>
294 static_assert(Prealloc > 0,
"QVarLengthArray Prealloc must be greater than 0.");
295 static_assert(
std::is_nothrow_destructible_v<T>,
"Types with throwing destructors are not supported in Qt containers.");
298 template <
typename U>
322 this->ptr =
this->array;
328 template <
typename U = T, if_copyable<U> =
true>
346 const auto otherInlineStorage =
reinterpret_cast<T*>(other.array);
347 if (data() == otherInlineStorage) {
349 this->ptr =
this->array;
350 QtPrivate::q_uninitialized_relocate_n(otherInlineStorage, size(), data());
357 other.ptr = otherInlineStorage;
365 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
374 if constexpr (QTypeInfo<T>::isComplex)
375 std::destroy_n(data(), size());
376 if (data() !=
reinterpret_cast<T *>(
this->array))
377 QtPrivate::sizedFree(data(), capacity(),
sizeof(T));
381 if (
this != &other) {
395 Q_ASSERT(capacity() >= Prealloc);
396 const auto otherInlineStorage = other.array;
397 if (other.ptr != otherInlineStorage) {
399 this->a =
std::exchange(other.a, Prealloc);
400 this->ptr =
std::exchange(other.ptr, otherInlineStorage);
403 QtPrivate::q_uninitialized_relocate_n(other.data(), other.size(), data());
405 this->s =
std::exchange(other.s, 0);
425 using Base::max_size;
445 void resize(qsizetype sz) { Base::resize_impl(Prealloc,
this->array, sz); }
447 template <
typename U = T, if_copyable<U> =
true>
450 { Base::resize_impl(Prealloc,
this->array, sz, v); }
455 void squeeze() { reallocate(size(), size()); }
457 using Base::capacity;
461 void reserve(qsizetype sz) {
if (sz > capacity()) reallocate(size(), sz); }
464 template <
typename AT =
T>
466 template <
typename AT =
T>
468 template <
typename AT =
T>
472 using Base::lastIndexOf;
473 using Base::contains;
487 using Base::operator[];
488 inline const T &
at(qsizetype idx)
const {
return operator[](idx); }
498 if (size() == capacity())
506 emplace_back(
std::move(t));
510 { Base::append_impl(Prealloc,
this->array, buf, sz); }
512 { append(t);
return *
this; }
514 { append(
std::move(t));
return *
this; }
516 { append(t);
return *
this; }
518 { append(
std::move(t));
return *
this; }
520#if QT_DEPRECATED_SINCE(6
, 3
)
528 void insert(qsizetype i, qsizetype n,
const T &t);
531 { Base::assign_impl(Prealloc,
this->array, n, t);
return *
this; }
532 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
534 { Base::assign_impl(Prealloc,
this->array, first, last);
return *
this; }
536 { assign(list.begin(), list.end());
return *
this; }
541 template <
typename AT =
T>
543 template <
typename AT =
T>
550 using Base::removeAll;
551 using Base::removeOne;
552 using Base::removeIf;
555 inline T *
data() {
return this->
ptr; }
556 inline const T *
data()
const {
return this->
ptr; }
590 {
return Base::insert_impl(Prealloc,
this->array, before, n, x); }
611 inline const T &
back()
const {
return last(); }
613 using Base::pop_back;
617 template <
typename...Args>
619 {
return Base::emplace_impl(Prealloc,
this->array, pos,
std::forward<Args>(args)...); }
620 template <
typename...Args>
622 {
return Base::emplace_back_impl(Prealloc,
this->array,
std::forward<Args>(args)...); }
642 template <
typename U = T, qsizetype Prealloc2 = Prealloc,
643 Qt::if_has_qt_compare_three_way<U, U> =
true>
647 return QtOrderingPrivate::lexicographicalCompareThreeWay(lhs.begin(), lhs.end(),
648 rhs.begin(), rhs.end());
651#if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts)
664 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
670 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
676#ifndef __cpp_lib_three_way_comparison
677 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
682 return lhs.less_than(rhs);
685 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
687 noexcept(
noexcept(
lhs <
rhs))
692 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
694 noexcept(
noexcept(
lhs <
rhs))
699 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
701 noexcept(
noexcept(
lhs <
rhs))
709 template <
typename U, qsizetype Prealloc2>
711 {
return Base::equal(other); }
712 template <
typename U, qsizetype Prealloc2>
714 {
return Base::less_than(other); }
716 void reallocate(qsizetype sz, qsizetype alloc)
717 { Base::reallocate_impl(Prealloc,
this->array, sz, alloc); }
719 using Base::isValidIterator;
722template <
typename InputIterator,
723 typename ValueType =
typename std::iterator_traits<InputIterator>::value_type,
724 QtPrivate::IfIsInputIterator<InputIterator> =
true>
725QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>;
727template <
class T, qsizetype Prealloc>
728Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(qsizetype asize)
731 Q_ASSERT_X(asize >= 0,
"QVarLengthArray::QVarLengthArray(qsizetype)",
732 "Size must be greater than or equal to 0.");
737 if (asize > Prealloc) {
739 this->ptr = QtPrivate::fittedMalloc(0, &
this->a,
sizeof(T));
740 Q_CHECK_PTR(
this->ptr);
742 if constexpr (QTypeInfo<T>::isComplex)
743 std::uninitialized_default_construct_n(data(), asize);
748template <
typename AT>
749Q_INLINE_TEMPLATE qsizetype QVLABase<T>::indexOf(
const AT &t, qsizetype from)
const
752 from = qMax(from + size(), qsizetype(0));
754 const T *n = data() + from - 1;
764template <
typename AT>
765Q_INLINE_TEMPLATE qsizetype QVLABase<T>::lastIndexOf(
const AT &t, qsizetype from)
const
769 else if (from >= size())
772 const T *b = begin();
773 const T *n = b + from + 1;
783template <
typename AT>
798 Q_ASSERT(abuf || increment == 0);
802 const qsizetype asize = size() + increment;
804 if (asize >= capacity())
805 growBy(prealloc, array, increment);
807 if constexpr (QTypeInfo<T>::isComplex)
808 std::uninitialized_copy_n(abuf, increment,
end());
810 memcpy(
static_cast<
void *>(
end()),
static_cast<
const void *>(abuf), increment *
sizeof(T));
819 if (n > capacity()) {
820 reallocate_impl(prealloc, array, 0, capacity());
821 resize_impl(prealloc, array, n, t);
823 auto mid = (std::min)(n, size());
824 std::fill(data(), data() + mid, t);
825 std::uninitialized_fill(data() + mid, data() + n, t);
827 erase(data() + n, data() + size());
832template <
typename Iterator>
835 std::forward_iterator_tag)
838 const qsizetype n =
std::distance(first, last);
840 reallocate_impl(prealloc, array, 0, n);
844 if constexpr (!QTypeInfo<T>::isComplex) {
850 dst =
std::copy(first, last, dst);
851 }
else if (n >
this->s) {
853 for (qsizetype i = 0; i <
this->s; ++i) {
858 std::uninitialized_copy_n(first, n -
this->s, dst);
861 dst =
std::copy(first, last, dst);
868template <
typename Iterator>
871 std::input_iterator_tag)
875 const auto dend =
end();
878 std::destroy(dst, dend);
883 emplace_back_impl(prealloc, array, *first);
884 }
while (++first != last);
895template <
typename Iterator>
899 using Cat =
typename std::iterator_traits<Iterator>::iterator_category;
900 assign_impl(prealloc, array, first, last, Cat{});
906 Q_ASSERT(aalloc >= asize);
909 qsizetype osize = size();
910 const qsizetype oalloc = capacity();
912 const qsizetype copySize = qMin(asize, osize);
913 Q_ASSERT(copySize >= 0);
915 if (aalloc != oalloc) {
919 if (aalloc > prealloc) {
920 newPtr = QtPrivate::fittedMalloc(0, &aalloc,
sizeof(T));
929 QtPrivate::q_uninitialized_relocate_n(oldPtr, copySize,
930 reinterpret_cast<T *>(newPtr));
939 if constexpr (QTypeInfo<T>::isComplex) {
941 std::destroy(oldPtr + asize, oldPtr + osize);
944 if (oldPtr !=
reinterpret_cast<T *>(array) && oldPtr != data())
945 QtPrivate::sizedFree(oldPtr, oalloc,
sizeof(T));
949Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i)
const
951 if (size_t(i) >= size_t(size()))
953 return operator[](i);
956Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i,
const T &defaultValue)
const
958 return (size_t(i) >= size_t(size())) ? defaultValue : operator[](i);
961template <
class T, qsizetype Prealloc>
964 insert(cbegin() + i,
std::move(t)); }
965template <
class T, qsizetype Prealloc>
968 insert(begin() + i, 1, t); }
969template <
class T, qsizetype Prealloc>
972 insert(begin() + i, n, t); }
976 erase(begin() + i, begin() + i + n); }
978template <
typename AT>
980{
return QtPrivate::sequential_erase_with_copy(*
this, t); }
982template <
typename AT>
984{
return QtPrivate::sequential_erase_one(*
this, t); }
986template <
typename Predicate>
988{
return QtPrivate::sequential_erase_if(*
this, pred); }
989#if QT_DEPRECATED_SINCE(6
, 3
)
990template <
class T, qsizetype Prealloc>
991inline void QVarLengthArray<T, Prealloc>::prepend(T &&t)
992{ insert(cbegin(), std::move(t)); }
993template <
class T, qsizetype Prealloc>
994inline void QVarLengthArray<T, Prealloc>::prepend(
const T &t)
995{ insert(begin(), 1, t); }
1006template <
typename...Args>
1009 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
1010 Q_ASSERT(size() <= capacity());
1011 Q_ASSERT(capacity() > 0);
1013 const qsizetype offset = qsizetype(before -
cbegin());
1014 emplace_back_impl(prealloc, array,
std::forward<Args>(args)...);
1015 const auto b =
begin() + offset;
1016 const auto e =
end();
1017 QtPrivate::q_rotate(b, e - 1, e);
1024 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
1026 const qsizetype offset = qsizetype(before -
cbegin());
1027 resize_impl(prealloc, array, size() + n, t);
1028 const auto b =
begin() + offset;
1029 const auto e =
end();
1030 QtPrivate::q_rotate(b, e - n, e);
1037 Q_ASSERT_X(
isValidIterator(abegin
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'abegin' is invalid");
1038 Q_ASSERT_X(
isValidIterator(aend
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'aend' is invalid");
1040 qsizetype f = qsizetype(abegin - cbegin());
1041 qsizetype l = qsizetype(aend - cbegin());
1042 qsizetype n = l - f;
1049 if constexpr (!QTypeInfo<T>::isRelocatable) {
1050 std::move(begin() + l, end(), QT_MAKE_CHECKED_ARRAY_ITERATOR(begin() + f, size() - f));
1051 std::destroy(end() - n, end());
1053 std::destroy(abegin, aend);
1054 memmove(
static_cast<
void *>(data() + f),
static_cast<
const void *>(data() + l), (size() - l) *
sizeof(T));
1062template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1063bool operator==(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1065template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1066bool operator!=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1068template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1069bool operator< (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1071template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1072bool operator> (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1074template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1075bool operator<=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1077template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1078bool operator>=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1082template <
typename T, qsizetype Prealloc>
1086 return key.hash(seed);
1089template <
typename T, qsizetype Prealloc,
typename AT>
1092 return array.removeAll(t);
1095template <
typename T, qsizetype Prealloc,
typename Predicate>
1098 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
std::unique_ptr< void, free_deleter > malloced_ptr
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
void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last, std::forward_iterator_tag)
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 value_type * const_pointer
const_reverse_iterator crbegin() const noexcept
std::reverse_iterator< const_iterator > const_reverse_iterator
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)
Q_OUTOFLINE_TEMPLATE void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last, std::input_iterator_tag)
void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last, std::input_iterator_tag)
void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last)
Q_OUTOFLINE_TEMPLATE void assign_impl(qsizetype prealloc, void *array, Iterator first, Iterator last, std::forward_iterator_tag)
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)
const value_type & const_reference
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)
typename Base::pointer pointer
T & emplace_back(Args &&...args)
const T & at(qsizetype idx) const
void resize(qsizetype sz)
QVarLengthArray< T, Prealloc > & operator=(const QVarLengthArray< T, Prealloc > &other)
typename Base::iterator iterator
typename Base::const_pointer const_pointer
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)
typename Base::reference reference
typename Base::size_type size_type
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)
typename Base::const_iterator const_iterator
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))
typename Base::value_type value_type
void resize(qsizetype sz, const T &v)
typename Base::const_reference const_reference
typename Base::difference_type difference_type
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())))
typename Base::reverse_iterator reverse_iterator
void insert(qsizetype i, const T &t)
const T * constData() const
typename Base::const_reverse_iterator const_reverse_iterator
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 bool grabMessageHandler()
void qt_message_output(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
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 bool qt_append_thread_name_to(QString &message)
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 void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf)
static const char timeTokenC[]
static bool isFatalCountDown(const char *varname, QBasicAtomicInt &n)
void qErrnoWarning(int code, const char *msg,...)
static const char qthreadptrTokenC[]
static const char fileTokenC[]
static const char ifDebugTokenC[]
static const char ifFatalTokenC[]
static const char categoryTokenC[]
static void stderr_message_handler(QtMsgType type, const QMessageLogContext &context, const QString &formattedMessage)
static const char lineTokenC[]
static const char typeTokenC[]
static void ungrabMessageHandler()
static void copyInternalContext(QInternalMessageLogContext *self, const QMessageLogContext &logContext) noexcept
static const char ifCategoryTokenC[]
static int checked_var_value(const char *varname)
static const char threadnameTokenC[]
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[]
void qErrnoWarning(const char *msg,...)
static const char functionTokenC[]
static const char ifWarningTokenC[]
static const char appnameTokenC[]
static bool isFatal(QtMsgType msgType)
static const char ifInfoTokenC[]
QtMessageHandler qInstallMessageHandler(QtMessageHandler h)
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.
void qSetMessagePattern(const QString &pattern)
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
#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