5#ifndef QVARLENGTHARRAY_H
6#define QVARLENGTHARRAY_H
9#pragma qt_class(QVarLengthArray)
10#pragma qt_sync_stop_processing
13#include <QtCore/qalloc.h>
14#include <QtCore/qcompare.h>
15#include <QtCore/qcontainerfwd.h>
16#include <QtCore/qglobal.h>
17#include <QtCore/qalgorithms.h>
18#include <QtCore/qcontainertools_impl.h>
19#include <QtCore/qhashfunctions.h>
20#include <QtCore/qttypetraits.h>
23#include <initializer_list>
25#include <QtCore/q20memory.h>
33template <size_t Size, size_t Align, qsizetype Prealloc>
36 template <size_t>
class print;
38 QVLAStorage() =
default;
39 QT_DECLARE_RO5_SMF_AS_DEFAULTED(QVLAStorage)
41 alignas(Align)
char array[Prealloc * (Align > Size ? Align : Size)];
43 QT_WARNING_DISABLE_DEPRECATED
46 static_assert(std::is_same_v<print<
sizeof(std::aligned_storage_t<Size, Align>[Prealloc])>,
47 print<
sizeof(array)>>);
65 Q_ASSERT(pos <= size());
67 Q_ASSERT(n <= size() - pos);
71 void operator()(
void *p)
const noexcept { free(p); }
80 constexpr bool empty()
const noexcept {
return size() == 0; }
91 T *
data()
noexcept {
return static_cast<
T *>(
ptr); }
92 const T *
data()
const noexcept {
return static_cast<
T *>(
ptr); }
148 if constexpr (QTypeInfo<T>::isComplex)
149 data()[size() - 1].~T();
153 template <
typename AT = T>
155 template <
typename AT = T>
157 template <
typename AT = T>
175 void remove(qsizetype i, qsizetype n = 1);
177 template <
typename AT = T>
179 template <
typename AT = T>
181 template <
typename Predicate>
186 if constexpr (QTypeInfo<T>::isComplex)
187 std::destroy_n(data(), size());
197 return (QtPrivate::MaxAllocSize /
sizeof(T)) - 1;
209 void growBy(qsizetype prealloc,
void *array, qsizetype increment)
210 { reallocate_impl(prealloc, array, size(), (std::max)(size() * 2, size() + increment)); }
211 template <
typename...Args>
214 if (size() == capacity())
215 growBy(prealloc, array, 1);
216 reference r = *q20::construct_at(end(), std::forward<Args>(args)...);
220 template <
typename...Args>
225 template <
typename S>
230 template <
typename S>
233 return std::lexicographical_compare(
begin(),
end(), other.begin(), other.end());
236 void append_impl(qsizetype prealloc,
void *array,
const T *buf, qsizetype n);
237 void reallocate_impl(qsizetype prealloc,
void *array, qsizetype size, qsizetype alloc);
238 void resize_impl(qsizetype prealloc,
void *array, qsizetype sz,
const T &v)
240 if (QtPrivate::q_points_into_range(&v, begin(), end())) {
241 resize_impl(prealloc, array, sz, T(v));
244 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
245 while (size() < sz) {
246 q20::construct_at(data() + size(), v);
252 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
253 if constexpr (QTypeInfo<T>::isComplex) {
255 while (size() < sz) {
256 q20::construct_at(data() + size());
264 void assign_impl(qsizetype prealloc,
void *array, qsizetype n,
const T &t);
265 template <
typename Iterator>
266 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last,
267 std::forward_iterator_tag);
268 template <
typename Iterator>
269 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last,
270 std::input_iterator_tag);
271 template <
typename Iterator>
272 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last);
276 const std::less<
const T *> less = {};
282template<
class T, qsizetype Prealloc>
284#if QT_VERSION >= QT_VERSION_CHECK(7
,0
,0
) || defined(QT_BOOTSTRAPPED)
292 template <
class S, qsizetype Prealloc2>
296 static_assert(Prealloc > 0,
"QVarLengthArray Prealloc must be greater than 0.");
297 static_assert(
std::is_nothrow_destructible_v<T>,
"Types with throwing destructors are not supported in Qt containers.");
300 template <
typename U>
324 this->ptr =
this->array;
330 template <
typename U = T, if_copyable<U> =
true>
348 const auto otherInlineStorage =
reinterpret_cast<T*>(other.array);
349 if (data() == otherInlineStorage) {
351 this->ptr =
this->array;
352 QtPrivate::q_uninitialized_relocate_n(otherInlineStorage, size(), data());
359 other.ptr = otherInlineStorage;
367 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
376 if constexpr (QTypeInfo<T>::isComplex)
377 std::destroy_n(data(), size());
378 if (data() !=
reinterpret_cast<T *>(
this->array))
379 QtPrivate::sizedFree(data(), capacity(),
sizeof(T));
383 if (
this != &other) {
397 Q_ASSERT(capacity() >= Prealloc);
398 const auto otherInlineStorage = other.array;
399 if (other.ptr != otherInlineStorage) {
401 this->a =
std::exchange(other.a, Prealloc);
402 this->ptr =
std::exchange(other.ptr, otherInlineStorage);
405 QtPrivate::q_uninitialized_relocate_n(other.data(), other.size(), data());
407 this->s =
std::exchange(other.s, 0);
427 using Base::max_size;
447 void resize(qsizetype sz) { Base::resize_impl(Prealloc,
this->array, sz); }
449 template <
typename U = T, if_copyable<U> =
true>
452 { Base::resize_impl(Prealloc,
this->array, sz, v); }
457 void squeeze() { reallocate(size(), size()); }
459 using Base::capacity;
463 void reserve(qsizetype sz) {
if (sz > capacity()) reallocate(size(), sz); }
466 template <
typename AT =
T>
468 template <
typename AT =
T>
470 template <
typename AT =
T>
474 using Base::lastIndexOf;
475 using Base::contains;
489 using Base::operator[];
490 inline const T &
at(qsizetype idx)
const {
return operator[](idx); }
500 if (size() == capacity())
508 emplace_back(
std::move(t));
512 { Base::append_impl(Prealloc,
this->array, buf, sz); }
514 { append(t);
return *
this; }
516 { append(
std::move(t));
return *
this; }
518 { append(t);
return *
this; }
520 { append(
std::move(t));
return *
this; }
522#if QT_DEPRECATED_SINCE(6
, 3
)
530 void insert(qsizetype i, qsizetype n,
const T &t);
533 { Base::assign_impl(Prealloc,
this->array, n, t);
return *
this; }
534 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
536 { Base::assign_impl(Prealloc,
this->array, first, last);
return *
this; }
538 { assign(list.begin(), list.end());
return *
this; }
544 template <
typename AT =
T>
546 template <
typename AT =
T>
553 using Base::removeAt;
554 using Base::removeAll;
555 using Base::removeOne;
556 using Base::removeIf;
559 inline T *
data() {
return this->
ptr; }
560 inline const T *
data()
const {
return this->
ptr; }
594 {
return Base::insert_impl(Prealloc,
this->array, before, n, x); }
615 inline const T &
back()
const {
return last(); }
617 using Base::pop_back;
621 template <
typename...Args>
623 {
return Base::emplace_impl(Prealloc,
this->array, pos,
std::forward<Args>(args)...); }
624 template <
typename...Args>
626 {
return Base::emplace_back_impl(Prealloc,
this->array,
std::forward<Args>(args)...); }
646 template <
typename U = T, qsizetype Prealloc2 = Prealloc,
647 Qt::if_has_qt_compare_three_way<U, U> =
true>
651 return QtOrderingPrivate::lexicographicalCompareThreeWay(lhs.begin(), lhs.end(),
652 rhs.begin(), rhs.end());
655#if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts)
668 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
674 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
680#ifndef __cpp_lib_three_way_comparison
681 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
686 return lhs.less_than(rhs);
689 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
691 noexcept(
noexcept(
lhs <
rhs))
696 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
698 noexcept(
noexcept(
lhs <
rhs))
703 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
705 noexcept(
noexcept(
lhs <
rhs))
713 template <
typename U, qsizetype Prealloc2>
715 {
return Base::equal(other); }
716 template <
typename U, qsizetype Prealloc2>
718 {
return Base::less_than(other); }
720 void reallocate(qsizetype sz, qsizetype alloc)
721 { Base::reallocate_impl(Prealloc,
this->array, sz, alloc); }
723 using Base::isValidIterator;
726template <
typename InputIterator,
727 typename ValueType =
typename std::iterator_traits<InputIterator>::value_type,
728 QtPrivate::IfIsInputIterator<InputIterator> =
true>
729QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>;
731template <
class T, qsizetype Prealloc>
732Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(qsizetype asize)
735 Q_ASSERT_X(asize >= 0,
"QVarLengthArray::QVarLengthArray(qsizetype)",
736 "Size must be greater than or equal to 0.");
741 if (asize > Prealloc) {
743 this->ptr = QtPrivate::fittedMalloc(0, &
this->a,
sizeof(T));
744 Q_CHECK_PTR(
this->ptr);
746 if constexpr (QTypeInfo<T>::isComplex)
747 std::uninitialized_default_construct_n(data(), asize);
752template <
typename AT>
753Q_INLINE_TEMPLATE qsizetype QVLABase<T>::indexOf(
const AT &t, qsizetype from)
const
756 from = qMax(from + size(), qsizetype(0));
758 const T *n = data() + from - 1;
768template <
typename AT>
769Q_INLINE_TEMPLATE qsizetype QVLABase<T>::lastIndexOf(
const AT &t, qsizetype from)
const
773 else if (from >= size())
776 const T *b = begin();
777 const T *n = b + from + 1;
787template <
typename AT>
802 Q_ASSERT(abuf || increment == 0);
806 const qsizetype asize = size() + increment;
808 if (asize >= capacity())
809 growBy(prealloc, array, increment);
811 if constexpr (QTypeInfo<T>::isComplex)
812 std::uninitialized_copy_n(abuf, increment,
end());
814 memcpy(
static_cast<
void *>(
end()),
static_cast<
const void *>(abuf), increment *
sizeof(T));
823 if (n > capacity()) {
824 reallocate_impl(prealloc, array, 0, capacity());
825 resize_impl(prealloc, array, n, t);
827 auto mid = (
std::min)(n, size());
828 std::fill(data(), data() + mid, t);
829 std::uninitialized_fill(data() + mid, data() + n, t);
831 erase(data() + n, data() + size());
836template <
typename Iterator>
839 std::forward_iterator_tag)
842 const qsizetype n =
std::distance(first, last);
844 reallocate_impl(prealloc, array, 0, n);
848 if constexpr (!QTypeInfo<T>::isComplex) {
854 dst =
std::copy(first, last, dst);
855 }
else if (n >
this->s) {
857 for (qsizetype i = 0; i <
this->s; ++i) {
862 std::uninitialized_copy_n(first, n -
this->s, dst);
865 dst =
std::copy(first, last, dst);
872template <
typename Iterator>
875 std::input_iterator_tag)
879 const auto dend =
end();
882 std::destroy(dst, dend);
887 emplace_back_impl(prealloc, array, *first);
888 }
while (++first != last);
899template <
typename Iterator>
903 using Cat =
typename std::iterator_traits<Iterator>::iterator_category;
904 assign_impl(prealloc, array, first, last, Cat{});
910 Q_ASSERT(aalloc >= asize);
913 qsizetype osize = size();
914 const qsizetype oalloc = capacity();
916 const qsizetype copySize = qMin(asize, osize);
917 Q_ASSERT(copySize >= 0);
919 if (aalloc != oalloc) {
923 if (aalloc > prealloc) {
924 newPtr = QtPrivate::fittedMalloc(0, &aalloc,
sizeof(T));
933 QtPrivate::q_uninitialized_relocate_n(oldPtr, copySize,
934 reinterpret_cast<T *>(newPtr));
943 if constexpr (QTypeInfo<T>::isComplex) {
945 std::destroy(oldPtr + asize, oldPtr + osize);
948 if (oldPtr !=
reinterpret_cast<T *>(array) && oldPtr != data())
949 QtPrivate::sizedFree(oldPtr, oalloc,
sizeof(T));
953Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i)
const
955 if (size_t(i) >= size_t(size()))
957 return operator[](i);
960Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i,
const T &defaultValue)
const
962 return (size_t(i) >= size_t(size())) ? defaultValue : operator[](i);
965template <
class T, qsizetype Prealloc>
968 insert(cbegin() + i,
std::move(t)); }
969template <
class T, qsizetype Prealloc>
972 insert(begin() + i, 1, t); }
973template <
class T, qsizetype Prealloc>
976 insert(begin() + i, n, t); }
980 erase(begin() + i, begin() + i + n); }
982template <
typename AT>
984{
return QtPrivate::sequential_erase_with_copy(*
this, t); }
986template <
typename AT>
988{
return QtPrivate::sequential_erase_one(*
this, t); }
990template <
typename Predicate>
992{
return QtPrivate::sequential_erase_if(*
this, pred); }
993#if QT_DEPRECATED_SINCE(6
, 3
)
994template <
class T, qsizetype Prealloc>
995inline void QVarLengthArray<T, Prealloc>::prepend(T &&t)
996{ insert(cbegin(), std::move(t)); }
997template <
class T, qsizetype Prealloc>
998inline void QVarLengthArray<T, Prealloc>::prepend(
const T &t)
999{ insert(begin(), 1, t); }
1010template <
typename...Args>
1013 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
1014 Q_ASSERT(size() <= capacity());
1015 Q_ASSERT(capacity() > 0);
1017 const qsizetype offset = qsizetype(before -
cbegin());
1018 emplace_back_impl(prealloc, array,
std::forward<Args>(args)...);
1019 const auto b =
begin() + offset;
1020 const auto e =
end();
1021 QtPrivate::q_rotate(b, e - 1, e);
1028 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
1030 const qsizetype offset = qsizetype(before -
cbegin());
1031 resize_impl(prealloc, array, size() + n, t);
1032 const auto b =
begin() + offset;
1033 const auto e =
end();
1034 QtPrivate::q_rotate(b, e - n, e);
1041 Q_ASSERT_X(
isValidIterator(abegin
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'abegin' is invalid");
1042 Q_ASSERT_X(
isValidIterator(aend
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'aend' is invalid");
1044 qsizetype f = qsizetype(abegin - cbegin());
1045 qsizetype l = qsizetype(aend - cbegin());
1046 qsizetype n = l - f;
1053 if constexpr (!QTypeInfo<T>::isRelocatable) {
1054 std::move(begin() + l,
end(), QT_MAKE_CHECKED_ARRAY_ITERATOR(begin() + f, size() - f));
1057 std::destroy(abegin, aend);
1058 memmove(
static_cast<
void *>(data() + f),
static_cast<
const void *>(data() + l), (size() - l) *
sizeof(T));
1066template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1067bool operator==(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1069template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1070bool operator!=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1072template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1073bool operator< (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1075template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1076bool operator> (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1078template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1079bool operator<=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1081template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1082bool operator>=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1086template <
typename T, qsizetype Prealloc>
1090 return key.hash(seed);
1093template <
typename T, qsizetype Prealloc,
typename AT>
1096 return array.removeAll(t);
1099template <
typename T, qsizetype Prealloc,
typename Predicate>
1102 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.
\macro QT_RESTRICTED_CAST_FROM_ASCII
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
void removeAt(qsizetype i)
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 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 Q_CONSTINIT bool msgHandlerGrabbed
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)
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)
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