View difference between Paste ID: rc6sDad6 and t4Bui9mJ
SHOW: | | - or go back to the newest paste.
1
#include <QtCore>
2
3
int main(int argc, char **argv)
4
{
5
    if (argc < 2)
6
        return 1;
7
    QFile file(QString::fromLocal8Bit(argv[1]));
8
    if (!file.open(QFile::ReadOnly))
9
        return 2;
10
    QRegExp rx("^Точка: (.*)$");
11-
    foreach (const QString &line, QTextStream(&file).readAll().split("\r\n")) {
11+
    QTextStream in(&file);
12-
        if (rx.indexIn(line) >= 0)
12+
    while (!in.atEnd()) {
13
        if (rx.indexIn(in.readLine()) >= 0)
14
            qDebug() << rx.cap(1);
15
    }
16
    return 0;
17
}