Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

qint64 QFile::readData ( char *  data,
qint64  len 
) [protected, virtual, inherited]

Implements QIODevice.

Definition at line 1503 of file qfile.cpp.

References QAbstractFileEngine::error(), QIODevice::errorString(), QFile::fileEngine(), QIODevice::read(), and QAbstractFileEngine::read().

{
    Q_D(QFile);
    d->error = NoError;
    if (!d->ensureFlushed())
        return -1;

    qint64 ret = -1;
    qint64 read = fileEngine()->read(data, len);
    if (read != -1)
        ret = read;

    if(ret < 0) {
        QFile::FileError err = fileEngine()->error();
        if(err == QFile::UnspecifiedError)
            err = QFile::ReadError;
        d->setError(err, fileEngine()->errorString());
    }
    return ret;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index