Rym Bouabid c39c3fe0cb QIODevice: Add overloads of QIODevice::readLineInto() that takes QSpan
The existing QIODevice::readLineInto takes a QByteArray *, so it's
dependent on a QByteArray and therefore needs at least one (initial)
allocation.
Add QIODevice::readLineInto() that takes a QSpan, allowing the user to
provide a buffer to write into and returns a QByteArrayView.

QBAV and QSpan are not null terminated. Make null termination optional
when reading using QIODevicePrivate::readLine(). Extend the function to
accept a ReadLineOption enum parameter with a default value of
"NullTerminated"  to preserve old calls. Do the same to
QRingBufferRef::readLine().
Add QRingBuffer::readLineWithoutTerminatingNull().

[ChangeLog][QtCore][QIODevice] Added overloads of
QIODevice::readLineInto() taking QSpan and returnig a QByteArrayView.

Task-number: QTBUG-126574
Change-Id: I278a42cef4c9aa64ed884027f79105b5b7d44813
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-12-02 16:43:50 +00:00
..