qt5base-lts/tests/auto/corelib/io/qtextstream
Alexander Volkov de71c8a6f8 Add QTextStream::readLine() overload
The most common use case for QTextStream::readLine() is reading
a file line by line in a loop. The existing readLine() method
allocates new memory for each line, that results in a loss of
speed. The introduced overload can use already allocated memory.

Besides it allows you to not think about filesystem specifics.
The current QFile documentation suggests a separate way to read
files from /proc filesystem. With this overload it's possible
to use the same idiom in all cases:

    QTextStream in(&file);
    QString line;
    while (in.readLine(&line)) {
        process_line(line);
    }

The idea was inspired by the blog post of Ivan Čukić:
http://ivan.fomentgroup.org/blog/2014/10/03/api-design-and-impact-on-the-performance-qt-vs-stl-example/

Change-Id: I0c62b4a52681870589bc099905e83ed69e03dd40
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-01-23 14:36:27 +01:00
..
readAllStdinProcess Update license headers and add new license files 2014-09-24 12:26:19 +02:00
readLineStdinProcess Update license headers and add new license files 2014-09-24 12:26:19 +02:00
resources Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
stdinProcess Update license headers and add new license files 2014-09-24 12:26:19 +02:00
test Set the Qt API level to compatibility mode in all tests. 2012-08-01 15:37:46 +02:00
.gitattributes Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
.gitignore Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
qtextstream.pro Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qtextstream.qrc Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
rfc3261.txt Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
shift-jis.txt Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
task113817.txt Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
tst_qtextstream.cpp Add QTextStream::readLine() overload 2015-01-23 14:36:27 +01:00