4#ifndef QVARLENGTHARRAY_H
5#define QVARLENGTHARRAY_H
8#pragma qt_class(QVarLengthArray)
9#pragma qt_sync_stop_processing
12#include <QtCore/qcontainerfwd.h>
13#include <QtCore/qglobal.h>
14#include <QtCore/qalgorithms.h>
15#include <QtCore/qcontainertools_impl.h>
16#include <QtCore/qhashfunctions.h>
17#include <QtCore/qttypetraits.h>
20#include <initializer_list>
22#include <QtCore/q20memory.h>
30template <size_t Size, size_t Align, qsizetype Prealloc>
33 template <size_t>
class print;
35 ~QVLAStorage() =
default;
37 alignas(Align)
char array[Prealloc * (Align > Size ? Align : Size)];
39 QT_WARNING_DISABLE_DEPRECATED
42 static_assert(std::is_same_v<print<
sizeof(std::aligned_storage_t<Size, Align>[Prealloc])>,
43 print<
sizeof(array)>>);
60 Q_ASSERT(pos <= size());
62 Q_ASSERT(n <= size() - pos);
66 void operator()(
void *p)
const noexcept { free(p); }
75 constexpr bool empty()
const noexcept {
return size() == 0; }
85 T *
data()
noexcept {
return static_cast<T *>(
ptr); }
86 const T *
data()
const noexcept {
return static_cast<T *>(
ptr); }
89 using const_iterator =
const T*;
91 iterator
begin()
noexcept {
return data(); }
92 const_iterator
begin()
const noexcept {
return data(); }
93 const_iterator
cbegin()
const noexcept {
return begin(); }
94 iterator
end()
noexcept {
return data() + size(); }
95 const_iterator
end()
const noexcept {
return data() + size(); }
96 const_iterator
cend()
const noexcept {
return end(); }
98 using reverse_iterator =
std::reverse_iterator<iterator>;
99 using const_reverse_iterator =
std::reverse_iterator<const_iterator>;
101 reverse_iterator
rbegin()
noexcept {
return reverse_iterator{end()}; }
102 const_reverse_iterator
rbegin()
const noexcept {
return const_reverse_iterator{end()}; }
103 const_reverse_iterator
crbegin()
const noexcept {
return rbegin(); }
104 reverse_iterator
rend()
noexcept {
return reverse_iterator{begin()}; }
105 const_reverse_iterator
rend()
const noexcept {
return const_reverse_iterator{begin()}; }
106 const_reverse_iterator
crend()
const noexcept {
return rend(); }
108 using value_type = T;
109 using reference = value_type&;
110 using const_reference =
const value_type&;
111 using pointer = value_type*;
112 using const_pointer =
const value_type*;
142 if constexpr (QTypeInfo<T>::isComplex)
143 data()[size() - 1].~T();
147 template <
typename AT = T>
149 template <
typename AT = T>
151 template <
typename AT = T>
165 value_type
value(qsizetype i)
const;
166 value_type
value(qsizetype i,
const T& defaultValue)
const;
169 void remove(qsizetype i, qsizetype n = 1);
170 template <
typename AT = T>
172 template <
typename AT = T>
174 template <
typename Predicate>
179 if constexpr (QTypeInfo<T>::isComplex)
180 std::destroy_n(data(), size());
184 iterator
erase(const_iterator begin, const_iterator end);
185 iterator
erase(const_iterator pos) {
return erase(pos, pos + 1); }
190 return (QtPrivate::MaxAllocSize /
sizeof(T)) - 1;
199 return qHashRange(begin(), end(), seed);
202 void growBy(qsizetype prealloc,
void *array, qsizetype increment)
203 { reallocate_impl(prealloc, array, size(), (std::max)(size() * 2, size() + increment)); }
204 template <
typename...Args>
207 if (size() == capacity())
208 growBy(prealloc, array, 1);
209 reference r = *q20::construct_at(end(), std::forward<Args>(args)...);
213 template <
typename...Args>
214 iterator
emplace_impl(qsizetype prealloc,
void *array, const_iterator pos, Args&&...arg);
216 iterator
insert_impl(qsizetype prealloc,
void *array, const_iterator pos, qsizetype n,
const T &t);
218 template <
typename S>
221 return std::equal(begin(), end(), other.begin(), other.end());
223 template <
typename S>
226 return std::lexicographical_compare(begin(), end(), other.begin(), other.end());
229 void append_impl(qsizetype prealloc,
void *array,
const T *buf, qsizetype n);
230 void reallocate_impl(qsizetype prealloc,
void *array, qsizetype size, qsizetype alloc);
231 void resize_impl(qsizetype prealloc,
void *array, qsizetype sz,
const T &v)
233 if (QtPrivate::q_points_into_range(&v, begin(), end())) {
234 resize_impl(prealloc, array, sz, T(v));
237 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
238 while (size() < sz) {
239 q20::construct_at(data() + size(), v);
245 reallocate_impl(prealloc, array, sz, qMax(sz, capacity()));
246 if constexpr (QTypeInfo<T>::isComplex) {
248 while (size() < sz) {
249 q20::construct_at(data() + size());
257 void assign_impl(qsizetype prealloc,
void *array, qsizetype n,
const T &t);
258 template <
typename Iterator>
259 void assign_impl(qsizetype prealloc,
void *array, Iterator first, Iterator last);
263 const std::less<
const T *> less = {};
269template<
class T, qsizetype Prealloc>
271#if QT_VERSION >= QT_VERSION_CHECK(7
,0
,0
) || defined(QT_BOOTSTRAPPED)
279 template <
class S, qsizetype Prealloc2>
283 static_assert(Prealloc > 0,
"QVarLengthArray Prealloc must be greater than 0.");
284 static_assert(
std::is_nothrow_destructible_v<T>,
"Types with throwing destructors are not supported in Qt containers.");
287 template <
typename U>
294 using size_type =
typename Base::size_type;
295 using value_type =
typename Base::value_type;
296 using pointer =
typename Base::pointer;
297 using const_pointer =
typename Base::const_pointer;
298 using reference =
typename Base::reference;
299 using const_reference =
typename Base::const_reference;
300 using difference_type =
typename Base::difference_type;
302 using iterator =
typename Base::iterator;
303 using const_iterator =
typename Base::const_iterator;
304 using reverse_iterator =
typename Base::reverse_iterator;
305 using const_reverse_iterator =
typename Base::const_reverse_iterator;
311 this->ptr =
this->array;
317 template <
typename U = T, if_copyable<U> =
true>
328 append(other.constData(), other.size());
335 const auto otherInlineStorage =
reinterpret_cast<T*>(other.array);
336 if (data() == otherInlineStorage) {
338 this->ptr =
this->array;
339 QtPrivate::q_uninitialized_relocate_n(otherInlineStorage, size(), data());
346 other.ptr = otherInlineStorage;
354 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
358 QtPrivate::reserveIfForwardIterator(
this, first, last);
359 std::copy(first, last,
std::back_inserter(*
this));
364 if constexpr (QTypeInfo<T>::isComplex)
365 std::destroy_n(data(), size());
366 if (data() !=
reinterpret_cast<T *>(
this->array))
371 if (
this != &other) {
373 append(other.constData(), other.size());
385 Q_ASSERT(capacity() >= Prealloc);
386 const auto otherInlineStorage = other.array;
387 if (other.ptr != otherInlineStorage) {
389 this->a =
std::exchange(other.a, Prealloc);
390 this->ptr =
std::exchange(other.ptr, otherInlineStorage);
393 QtPrivate::q_uninitialized_relocate_n(other.data(), other.size(), data());
395 this->s =
std::exchange(other.s, 0);
415 using Base::max_size;
435 void resize(qsizetype sz) { Base::resize_impl(Prealloc,
this->array, sz); }
437 template <
typename U = T, if_copyable<U> =
true>
440 { Base::resize_impl(Prealloc,
this->array, sz, v); }
445 void squeeze() { reallocate(size(), size()); }
447 using Base::capacity;
451 void reserve(qsizetype sz) {
if (sz > capacity()) reallocate(size(), sz); }
454 template <
typename AT =
T>
456 template <
typename AT =
T>
458 template <
typename AT =
T>
462 using Base::lastIndexOf;
463 using Base::contains;
477 using Base::operator[];
478 inline const T &
at(qsizetype idx)
const {
return operator[](idx); }
488 if (size() == capacity())
496 emplace_back(
std::move(t));
500 { Base::append_impl(Prealloc,
this->array, buf, sz); }
502 { append(t);
return *
this; }
504 { append(
std::move(t));
return *
this; }
506 { append(t);
return *
this; }
508 { append(
std::move(t));
return *
this; }
510#if QT_DEPRECATED_SINCE(6
, 3
)
518 void insert(qsizetype i, qsizetype n,
const T &t);
521 { Base::assign_impl(Prealloc,
this->array, n, t);
return *
this; }
522 template <
typename InputIterator, if_input_iterator<InputIterator> =
true>
524 { Base::assign_impl(Prealloc,
this->array, first, last);
return *
this; }
526 { assign(list.begin(), list.end());
return *
this; }
531 template <
typename AT =
T>
533 template <
typename AT =
T>
540 using Base::removeAll;
541 using Base::removeOne;
542 using Base::removeIf;
545 inline T *
data() {
return this->
ptr; }
546 inline const T *
data()
const {
return this->
ptr; }
562 auto constBegin()
const -> const_iterator {
return begin(); }
565 inline const_iterator
constEnd()
const {
return end(); }
579 iterator
insert(const_iterator before, qsizetype n,
const T &x)
580 {
return Base::insert_impl(Prealloc,
this->array, before, n, x); }
581 iterator
insert(const_iterator before, T &&x) {
return emplace(before,
std::move(x)); }
582 inline iterator
insert(const_iterator before,
const T &x) {
return insert(before, 1, x); }
601 inline const T &
back()
const {
return last(); }
603 using Base::pop_back;
607 template <
typename...Args>
608 iterator
emplace(const_iterator pos, Args &&...args)
609 {
return Base::emplace_impl(Prealloc,
this->array, pos,
std::forward<Args>(args)...); }
610 template <
typename...Args>
612 {
return Base::emplace_back_impl(Prealloc,
this->array,
std::forward<Args>(args)...); }
629 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
635 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
641 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
646 return lhs.less_than(rhs);
649 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
651 noexcept(
noexcept(
lhs <
rhs))
656 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
658 noexcept(
noexcept(
lhs <
rhs))
663 template <
typename U = T, qsizetype Prealloc2 = Prealloc>
friend
665 noexcept(
noexcept(
lhs <
rhs))
672 template <
typename U, qsizetype Prealloc2>
674 {
return Base::equal(other); }
675 template <
typename U, qsizetype Prealloc2>
677 {
return Base::less_than(other); }
679 void reallocate(qsizetype sz, qsizetype alloc)
680 { Base::reallocate_impl(Prealloc,
this->array, sz, alloc); }
682 using Base::isValidIterator;
685template <
typename InputIterator,
686 typename ValueType =
typename std::iterator_traits<InputIterator>::value_type,
687 QtPrivate::IfIsInputIterator<InputIterator> =
true>
688QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>;
690template <
class T, qsizetype Prealloc>
691Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(qsizetype asize)
694 Q_ASSERT_X(asize >= 0,
"QVarLengthArray::QVarLengthArray(qsizetype)",
695 "Size must be greater than or equal to 0.");
700 if (asize > Prealloc) {
701 this->ptr = malloc(asize *
sizeof(T));
702 Q_CHECK_PTR(
this->ptr);
705 if constexpr (QTypeInfo<T>::isComplex)
706 std::uninitialized_default_construct_n(data(), asize);
711template <
typename AT>
712Q_INLINE_TEMPLATE qsizetype QVLABase<T>::indexOf(
const AT &t, qsizetype from)
const
715 from = qMax(from + size(), qsizetype(0));
717 const T *n = data() + from - 1;
727template <
typename AT>
728Q_INLINE_TEMPLATE qsizetype QVLABase<T>::lastIndexOf(
const AT &t, qsizetype from)
const
732 else if (from >= size())
735 const T *b = begin();
736 const T *n = b + from + 1;
746template <
typename AT>
749 const T *b = begin();
761 Q_ASSERT(abuf || increment == 0);
765 const qsizetype asize = size() + increment;
767 if (asize >= capacity())
768 growBy(prealloc, array, increment);
770 if constexpr (QTypeInfo<T>::isComplex)
771 std::uninitialized_copy_n(abuf, increment, end());
773 memcpy(
static_cast<
void *>(end()),
static_cast<
const void *>(abuf), increment *
sizeof(T));
782 if (n > capacity()) {
783 reallocate_impl(prealloc, array, 0, capacity());
784 resize_impl(prealloc, array, n, t);
786 auto mid = (std::min)(n, size());
787 std::fill(data(), data() + mid, t);
788 std::uninitialized_fill(data() + mid, data() + n, t);
790 erase(data() + n, data() + size());
795template <
typename Iterator>
799 constexpr bool IsFwdIt =
800 std::is_convertible_v<
typename std::iterator_traits<Iterator>::iterator_category,
801 std::forward_iterator_tag>;
802 if constexpr (IsFwdIt) {
803 const qsizetype n = std::distance(first, last);
805 reallocate_impl(prealloc, array, 0, n);
809 const auto dend = end();
812 std::destroy(dst, dend);
816 if constexpr (IsFwdIt) {
817 dst =
std::uninitialized_copy(first, last, dst);
821 emplace_back_impl(prealloc, array, *first);
822 }
while (++first != last);
830 this->s = dst - begin();
836 Q_ASSERT(aalloc >= asize);
839 qsizetype osize = size();
841 const qsizetype copySize = qMin(asize, osize);
842 Q_ASSERT(copySize >= 0);
844 if (aalloc != capacity()) {
845 QVLABaseBase::malloced_ptr guard;
848 if (aalloc > prealloc) {
849 newPtr = malloc(aalloc *
sizeof(T));
858 QtPrivate::q_uninitialized_relocate_n(oldPtr, copySize,
859 reinterpret_cast<T *>(newPtr));
868 if constexpr (QTypeInfo<T>::isComplex) {
870 std::destroy(oldPtr + asize, oldPtr + osize);
873 if (oldPtr !=
reinterpret_cast<T *>(array) && oldPtr != data())
878Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i)
const
880 if (size_t(i) >= size_t(size()))
882 return operator[](i);
885Q_OUTOFLINE_TEMPLATE T QVLABase<T>::value(qsizetype i,
const T &defaultValue)
const
887 return (size_t(i) >= size_t(size())) ? defaultValue : operator[](i);
890template <
class T, qsizetype Prealloc>
893 insert(cbegin() + i,
std::move(t)); }
894template <
class T, qsizetype Prealloc>
897 insert(begin() + i, 1, t); }
898template <
class T, qsizetype Prealloc>
901 insert(begin() + i, n, t); }
905 erase(begin() + i, begin() + i + n); }
907template <
typename AT>
909{
return QtPrivate::sequential_erase_with_copy(*
this, t); }
911template <
typename AT>
913{
return QtPrivate::sequential_erase_one(*
this, t); }
915template <
typename Predicate>
917{
return QtPrivate::sequential_erase_if(*
this, pred); }
918#if QT_DEPRECATED_SINCE(6
, 3
)
919template <
class T, qsizetype Prealloc>
920inline void QVarLengthArray<T, Prealloc>::prepend(T &&t)
921{ insert(cbegin(), std::move(t)); }
922template <
class T, qsizetype Prealloc>
923inline void QVarLengthArray<T, Prealloc>::prepend(
const T &t)
924{ insert(begin(), 1, t); }
935template <
typename...Args>
938 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
939 Q_ASSERT(size() <= capacity());
940 Q_ASSERT(capacity() > 0);
942 const qsizetype offset = qsizetype(before - cbegin());
943 emplace_back_impl(prealloc, array,
std::forward<Args>(args)...);
944 const auto b = begin() + offset;
945 const auto e = end();
946 QtPrivate::q_rotate(b, e - 1, e);
953 Q_ASSERT_X(
isValidIterator(before
),
"QVarLengthArray::insert",
"The specified const_iterator argument 'before' is invalid");
955 const qsizetype offset = qsizetype(before - cbegin());
956 resize_impl(prealloc, array, size() + n, t);
957 const auto b = begin() + offset;
958 const auto e = end();
959 QtPrivate::q_rotate(b, e - n, e);
966 Q_ASSERT_X(
isValidIterator(abegin
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'abegin' is invalid");
967 Q_ASSERT_X(
isValidIterator(aend
),
"QVarLengthArray::erase",
"The specified const_iterator argument 'aend' is invalid");
969 qsizetype f = qsizetype(abegin - cbegin());
970 qsizetype l = qsizetype(aend - cbegin());
978 if constexpr (!QTypeInfo<T>::isRelocatable) {
979 std::move(begin() + l, end(), QT_MAKE_CHECKED_ARRAY_ITERATOR(begin() + f, size() - f));
980 std::destroy(end() - n, end());
982 std::destroy(abegin, aend);
983 memmove(
static_cast<
void *>(data() + f),
static_cast<
const void *>(data() + l), (size() - l) *
sizeof(T));
991template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
992bool operator==(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
994template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
995bool operator!=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
997template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
998bool operator< (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1000template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1001bool operator> (
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1003template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1004bool operator<=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1006template <
typename T, qsizetype Prealloc1, qsizetype Prealloc2>
1007bool operator>=(
const QVarLengthArray<T, Prealloc1> &l,
const QVarLengthArray<T, Prealloc2> &r)
1011template <
typename T, qsizetype Prealloc>
1015 return key.hash(seed);
1018template <
typename T, qsizetype Prealloc,
typename AT>
1021 return array.removeAll(t);
1024template <
typename T, qsizetype Prealloc,
typename Predicate>
1027 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
static void setFilterRules(const QString &rules)
Configures which categories and message types should be enabled through a set of rules.
~QLoggingCategory()
Destroys a QLoggingCategory object.
bool isInfoEnabled() const
Returns true if informational messages should be shown for this category; false otherwise.
static QLoggingCategory * defaultCategory()
Returns a pointer to the global category "default" that is used, for example, by qDebug(),...
QLoggingCategory & operator()()
Returns the object itself.
void(*) CategoryFilter(QLoggingCategory *)
This is a typedef for a pointer to a function with the following signature:
void setEnabled(QtMsgType type, bool enable)
Changes the message type type for the category to enable.
static CategoryFilter installFilter(CategoryFilter)
Take control of how logging categories are configured.
bool isWarningEnabled() const
Returns true if warning messages should be shown for this category; false otherwise.
bool isEnabled(QtMsgType type) const
Returns true if a message of type msgtype for the category should be shown; false otherwise.
bool isCriticalEnabled() const
Returns true if critical messages should be shown for this category; false otherwise.
const char * categoryName() const
Returns the name of the category.
bool isDebugEnabled() const
Returns true if debug messages should be shown for this category; false otherwise.
constexpr QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) noexcept
constexpr QMessageLogContext() noexcept=default
QDebug debug(CategoryFunction catFunc) const
Logs a debug message into category returned by catFunc using a QDebug stream.
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.
QDebug info(CategoryFunction catFunc) const
Logs an informational message into category returned by catFunc using a QDebug stream.
QNoDebug noDebug() const noexcept
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 T * data() const 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)
Q_OUTOFLINE_TEMPLATE auto emplace_impl(qsizetype prealloc, void *array, const_iterator before, Args &&...args) -> iterator
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)
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 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
#define HANDLE_IF_TOKEN(LEVEL)
static const char defaultPattern[]
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 Q_NORETURN void qt_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message)
\inmodule QtCore \title Qt Logging Types
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.
bool shouldLogToStderr()
Returns true if logging stderr should be ensured.
QByteArray operator""_ba(const char *str, size_t size) noexcept
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)
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(*)()>
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
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 >)
void setPattern(const QString &pattern)
std::unique_ptr< std::unique_ptr< const char[]>[]> literals
std::unique_ptr< const char *[]> tokens
QList< QString > timeArgs
void operator()(void *p) const noexcept