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);
176 template <
typename AT = T>
178 template <
typename AT = T>
180 template <
typename Predicate>
185 if constexpr (QTypeInfo<T>::isComplex)
186 std::destroy_n(data(), size());
196 return (QtPrivate::MaxAllocSize /
sizeof(T)) - 1;
208 void growBy(qsizetype prealloc,
void *array, qsizetype increment)
209 { reallocate_impl(prealloc, array, size(), (std::max)(size() * 2, size() + increment)); }
210 template <
typename...Args>
213 if (size() == capacity())
214 growBy(prealloc, array, 1);
215 reference r = *q20::construct_at(end(), std::forward<Args>(args)...);
219 template <
typename...Args>
224 template <
typename S>
229 template <
typename S>
232 return std::lexicographical_compare(
begin(),
end(), other.begin(), other.end());
235 void append_impl(qsizetype prealloc,
void *array,
const T *buf, qsizetype n);
236 void reallocate_impl(qsizetype prealloc,
void *array, qsizetype size, qsizetype alloc);
237 void resize_impl(qsizetype prealloc,
void *array, qsizetype sz,
const T &v)
239 if (QtPrivate::q_points_into_range(&v, begin(), end())) {
240 resize_impl(prealloc, array, sz, T(v));
243 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
244 while (size() < sz) {
245 q20::construct_at(data() + size(), v);
251 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
252 if constexpr (QTypeInfo<T>::isComplex) {
254 while (size() < sz) {
255 q20::construct_at(data() + size());
263 void assign_impl(qsizetype prealloc,
void *array, qsizetype n,
const T &t);
264 template <
typename Iterator>
265 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last,
266 std::forward_iterator_tag);
267 template <
typename Iterator>
268 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last,
269 std::input_iterator_tag);
270 template <
typename Iterator>
271 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last);
275 const std::less<
const T *> less = {};
281template<
class T, qsizetype Prealloc>
283#if QT_VERSION >= QT_VERSION_CHECK(7
,0
,0
) || defined(QT_BOOTSTRAPPED)
291 template <
class S, qsizetype Prealloc2>
295 static_assert(Prealloc > 0,
"QVarLengthArray Prealloc must be greater than 0.");
296 static_assert(
std::is_nothrow_destructible_v<T>,
"Types with throwing destructors are not supported in Qt containers.");
299 template <
typename U>
323 this->ptr =
this->array;
329 template <
typename U = T, if_copyable<U> =
true>
347 const auto otherInlineStorage =
reinterpret_cast<T*>(other.array);
348 if (data() == otherInlineStorage) {
350 this->ptr =
this->array;
351 QtPrivate::q_uninitialized_relocate_n(otherInlineStorage, size(), data());
358 other.ptr = otherInlineStorage;
366 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
375 if constexpr (QTypeInfo<T>::isComplex)
376 std::destroy_n(data(), size());
377 if (data() !=
reinterpret_cast<T *>(
this->array))
378 QtPrivate::sizedFree(data(), capacity(),
sizeof(T));
382 if (
this != &other) {
396 Q_ASSERT(capacity() >= Prealloc);
397 const auto otherInlineStorage = other.array;
398 if (other.ptr != otherInlineStorage) {
400 this->a =
std::exchange(other.a, Prealloc);
401 this->ptr =
std::exchange(other.ptr, otherInlineStorage);
404 QtPrivate::q_uninitialized_relocate_n(other.data(), other.size(), data());
406 this->s =
std::exchange(other.s, 0);
426 using Base::max_size;
446 void resize(qsizetype sz) { Base::resize_impl(Prealloc,
this->array, sz); }
448 template <
typename U = T, if_copyable<U> =
true>
451 { Base::resize_impl(Prealloc,
this->array, sz, v); }
456 void squeeze() { reallocate(size(), size()); }
458 using Base::capacity;
462 void reserve(qsizetype sz) {
if (sz > capacity()) reallocate(size(), sz); }
465 template <
typename AT =
T>
467 template <
typename AT =
T>
469 template <
typename AT =
T>
473 using Base::lastIndexOf;
474 using Base::contains;
488 using Base::operator[];
489 inline const T &
at(qsizetype idx)
const {
return operator[](idx); }
499 if (size() == capacity())
507 emplace_back(
std::move(t));
511 { Base::append_impl(Prealloc,
this->array, buf, sz); }
513 { append(t);
return *
this; }
515 { append(
std::move(t));
return *
this; }
517 { append(t);
return *
this; }
519 { append(
std::move(t));
return *
this; }
521#if QT_DEPRECATED_SINCE(6
, 3
)
529 void insert(qsizetype i, qsizetype n,
const T &t);
532 { Base::assign_impl(Prealloc,
this->array, n, t);
return *
this; }
533 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
535 { Base::assign_impl(Prealloc,
this->array, first, last);
return *
this; }
537 { assign(list.begin(), list.end());
return *
this; }
542 template <
typename AT =
T>
544 template <
typename AT =
T>
551 using Base::removeAll;
552 using Base::removeOne;
553 using Base::removeIf;
556 inline T *
data() {
return this->
ptr; }
557 inline const T *
data()
const {
return this->
ptr; }
591 {
return Base::insert_impl(Prealloc,
this->array, before, n, x); }
612 inline const T &
back()
const {
return last(); }
614 using Base::pop_back;
618 template <
typename...Args>
620 {
return Base::emplace_impl(Prealloc,
this->array, pos,
std::forward<Args>(args)...); }
621 template <
typename...Args>
623 {
return Base::emplace_back_impl(Prealloc,
this->array,
std::forward<Args>(args)...); }
643 template <
typename U = T, qsizetype Prealloc2 = Prealloc,
644 Qt::if_has_qt_compare_three_way<U, U> =
true>
648 return QtOrderingPrivate::lexicographicalCompareThreeWay(lhs.begin(), lhs.end(),
649 rhs.begin(), rhs.end());
652#if defined(__cpp_lib_three_way_comparison) && defined(__cpp_lib_concepts)
665 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
671 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
677#ifndef __cpp_lib_three_way_comparison
678 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
683 return lhs.less_than(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))
700 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
702 noexcept(
noexcept(
lhs <
rhs))
710 template <
typename U, qsizetype Prealloc2>
712 {
return Base::equal(other); }
713 template <
typename U, qsizetype Prealloc2>
715 {
return Base::less_than(other); }
717 void reallocate(qsizetype sz, qsizetype alloc)
718 { Base::reallocate_impl(Prealloc,
this->array, sz, alloc); }
720 using Base::isValidIterator;
723template <
typename InputIterator,
724 typename ValueType =
typename std::iterator_traits<InputIterator>::value_type,
725 QtPrivate::IfIsInputIterator<InputIterator> =
true>
726QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>;
728template <
class T, qsizetype Prealloc>
729Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(qsizetype asize)
732 Q_ASSERT_X(asize >= 0,
"QVarLengthArray::QVarLengthArray(qsizetype)",
733 "Size must be greater than or equal to 0.");
738 if (asize > Prealloc) {
740 this->ptr = QtPrivate::fittedMalloc(0, &
this->a,
sizeof(T));
741 Q_CHECK_PTR(
this->ptr);
743 if constexpr (QTypeInfo<T>::isComplex)
744 std::uninitialized_default_construct_n(data(), asize);
749template <
typename AT>
750Q_INLINE_TEMPLATE qsizetype QVLABase<T>::indexOf(
const AT &t, qsizetype from)
const
753 from = qMax(from + size(), qsizetype(0));
755 const T *n = data() + from - 1;
765template <
typename AT>
766Q_INLINE_TEMPLATE qsizetype QVLABase<T>::lastIndexOf(
const AT &t, qsizetype from)
const
770 else if (from >= size())
773 const T *b = begin();
774 const T *n = b + from + 1;
784template <
typename AT>
799 Q_ASSERT(abuf || increment == 0);
803 const qsizetype asize = size() + increment;
805 if (asize >= capacity())
806 growBy(prealloc, array, increment);
808 if constexpr (QTypeInfo<T>::isComplex)
809 std::uninitialized_copy_n(abuf, increment,
end());
811 memcpy(
static_cast<
void *>(
end()),
static_cast<
const void *>(abuf), increment *
sizeof(T));
820 if (n > capacity()) {
821 reallocate_impl(prealloc, array, 0, capacity());
822 resize_impl(prealloc, array, n, t);
824 auto mid = (
std::min)(n, size());
825 std::fill(data(), data() + mid, t);
826 std::uninitialized_fill(data() + mid, data() + n, t);
828 erase(data() + n, data() + size());
833template <
typename Iterator>
836 std::forward_iterator_tag)
839 const qsizetype n =
std::distance(first, last);
841 reallocate_impl(prealloc, array, 0, n);
845 if constexpr (!QTypeInfo<T>::isComplex) {
851 dst =
std::copy(first, last, dst);
852 }
else if (n >
this->s) {
854 for (qsizetype i = 0; i <
this->s; ++i) {
859 std::uninitialized_copy_n(first, n -
this->s, dst);
862 dst =
std::copy(first, last, dst);
869template <
typename Iterator>
872 std::input_iterator_tag)
876 const auto dend =
end();
879 std::destroy(dst, dend);
884 emplace_back_impl(prealloc, array, *first);
885 }
while (++first != last);
896template <
typename Iterator>
900 using Cat =
typename std::iterator_traits<Iterator>::iterator_category;
901 assign_impl(prealloc, array, first, last, Cat{});
907 Q_ASSERT(aalloc >= asize);
910 qsizetype osize = size();
911 const qsizetype oalloc = capacity();
913 const qsizetype copySize = qMin(asize, osize);
914 Q_ASSERT(copySize >= 0);
916 if (aalloc != oalloc) {
920 if (aalloc > prealloc) {
921 newPtr = QtPrivate::fittedMalloc(0, &aalloc,
sizeof(T));
930 QtPrivate::q_uninitialized_relocate_n(oldPtr, copySize,
931 reinterpret_cast<T *>(newPtr));
940 if constexpr (QTypeInfo<T>::isComplex) {
942 std::destroy(oldPtr + asize, oldPtr + osize);
945 if (oldPtr !=
reinterpret_cast<T *>(array) && oldPtr != data())
946 QtPrivate::sizedFree(oldPtr, oalloc,
sizeof(T));
950Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i)
const
952 if (size_t(i) >= size_t(size()))
954 return operator[](i);
957Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i,
const T &defaultValue)
const
959 return (size_t(i) >= size_t(size())) ? defaultValue : operator[](i);
962template <
class T, qsizetype Prealloc>
965 insert(cbegin() + i,
std::move(t)); }
966template <
class T, qsizetype Prealloc>
969 insert(begin() + i, 1, t); }
970template <
class T, qsizetype Prealloc>
973 insert(begin() + i, n, t); }
977 erase(begin() + i, begin() + i + n); }
979template <
typename AT>
981{
return QtPrivate::sequential_erase_with_copy(*
this, t); }
983template <
typename AT>
985{
return QtPrivate::sequential_erase_one(*
this, t); }
987template <
typename Predicate>
989{
return QtPrivate::sequential_erase_if(*
this, pred); }
990#if QT_DEPRECATED_SINCE(6
, 3
)
991template <
class T, qsizetype Prealloc>
992inline void QVarLengthArray<T, Prealloc>::prepend(T &&t)
993{ insert(cbegin(), std::move(t)); }
994template <
class T, qsizetype Prealloc>
995inline void QVarLengthArray<T, Prealloc>::prepend(
const T &t)
996{ insert(begin(), 1, t); }
1007template <
typename...Args>
1010 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
1011 Q_ASSERT(size() <= capacity());
1012 Q_ASSERT(capacity() > 0);
1014 const qsizetype offset = qsizetype(before -
cbegin());
1015 emplace_back_impl(prealloc, array,
std::forward<Args>(args)...);
1016 const auto b =
begin() + offset;
1017 const auto e =
end();
1018 QtPrivate::q_rotate(b, e - 1, e);
1025 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
1027 const qsizetype offset = qsizetype(before -
cbegin());
1028 resize_impl(prealloc, array, size() + n, t);
1029 const auto b =
begin() + offset;
1030 const auto e =
end();
1031 QtPrivate::q_rotate(b, e - n, e);
1038 Q_ASSERT_X(
isValidIterator(abegin
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'abegin' is invalid");
1039 Q_ASSERT_X(
isValidIterator(aend
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'aend' is invalid");
1041 qsizetype f = qsizetype(abegin - cbegin());
1042 qsizetype l = qsizetype(aend - cbegin());
1043 qsizetype n = l - f;
1050 if constexpr (!QTypeInfo<T>::isRelocatable) {
1051 std::move(begin() + l,
end(), QT_MAKE_CHECKED_ARRAY_ITERATOR(begin() + f, size() - f));
1054 std::destroy(abegin, aend);
1055 memmove(
static_cast<
void *>(data() + f),
static_cast<
const void *>(data() + l), (size() - l) *
sizeof(T));
1063template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1064bool operator==(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
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)
1083template <
typename T, qsizetype Prealloc>
1087 return key.hash(seed);
1090template <
typename T, qsizetype Prealloc,
typename AT>
1093 return array.removeAll(t);
1096template <
typename T, qsizetype Prealloc,
typename Predicate>
1099 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
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