Fix qdoc warnings for QByteArrayView

Provide simplified declaration of fromArray for qdoc runs;  fix a small typo.

Change-Id: I8c7300a014270e8ab7f18afd94ee66af4734e0c7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
bb10
Volker Hilsheimer 2020-09-23 11:57:02 +02:00
parent 1cbfaebfc9
commit 3299476791
2 changed files with 8 additions and 5 deletions

View File

@ -203,10 +203,13 @@ public:
constexpr QByteArrayView(const char (&data)[Size]) noexcept
: QByteArrayView(data, lengthHelperCharArray(data, Size)) {}
#ifdef Q_QDOC
template <typename Byte, size_t Size>
#else
template <typename Byte, size_t Size, if_compatible_byte<Byte> = true>
#endif
[[nodiscard]] constexpr static QByteArrayView fromArray(const Byte (&data)[Size]) noexcept
{ return QByteArrayView(data, Size); }
[[nodiscard]] inline QByteArray toByteArray() const; // defined in qbytearray.h
[[nodiscard]] constexpr qsizetype size() const noexcept { return m_size; }

View File

@ -256,7 +256,7 @@
*/
/*!
\fn template <size_t Size> QByteArrayView(const char (&data)[Size])
\fn template <size_t Size> QByteArrayView::QByteArrayView(const char (&data)[Size])
Constructs a byte array view on the char array \a data.
The view covers the array until the first \c{'\0'} is encountered,
@ -302,7 +302,7 @@
*/
/*!
\fn template <typename Byte, size_t Size> static QByteArrayView QByteArrayView::fromArray(Byte (&data)[Size])
\fn template <typename Byte, size_t Size> QByteArrayView QByteArrayView::fromArray(const Byte (&data)[Size])
Constructs a byte array view on the array literal \a data. The view covers the full
array. That includes the trailing null-terminator of \c{char} array literals.
@ -602,7 +602,7 @@
\note The behavior is undefined when \a length < 0 or \a length > size().
\sa first(), last(), sliced(), right(), chopped(), chop()
\sa first(), last(), sliced(), chopped(), chop()
*/
/*!
@ -677,7 +677,7 @@
*/
/*!
\fn qizetype QByteArrayView::count(QByteArrayView bv) const
\fn qsizetype QByteArrayView::count(QByteArrayView bv) const
Returns the number of (potentially overlapping) occurrences of the
sequence of bytes viewed by \a bv in this byte array view.