QIODevice: improve QIODevice::readLine() documentation

Pick-to: 6.7 6.5
Change-Id: I252c0faf982ff8328475243fdbc86cc4d1462498
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit bbf980e43f16c99504d75998217b88855edd3365)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Rym Bouabid 2024-08-28 14:32:22 +02:00 committed by Qt Cherry-pick Bot
parent e99c2d9314
commit 57f2dff05c

View File

@ -1430,6 +1430,12 @@ qint64 QIODevicePrivate::readLine(char *data, qint64 maxSize)
Reads a line from the device, but no more than \a maxSize characters, Reads a line from the device, but no more than \a maxSize characters,
and returns the result as a byte array. and returns the result as a byte array.
If \a maxSize is 0 or not specified, the line can be of any length,
thereby enabling unlimited reading.
The resulting line can have trailing end-of-line characters ("\n" or "\r\n"),
so calling QByteArray::trimmed() may be necessary.
This function has no way of reporting errors; returning an empty This function has no way of reporting errors; returning an empty
QByteArray can mean either that no data was currently available QByteArray can mean either that no data was currently available
for reading, or that an error occurred. for reading, or that an error occurred.