summaryrefslogblamecommitdiffstats
path: root/src/util/TextFile.cpp
blob: 0d04e47286b95e927e6791a59dabc21163872ce1 (plain) (tree)






































                                                     
/*
 * TextFile.cpp
 *
 *  Created on: 13.02.2010
 *      Author: Zahl
 */

#include "TextFile.h"

TextFile::TextFile(QString filename) : QTextStream()
{
    _file = new QFile(filename);
    if (_file->open(QIODevice::ReadOnly))
    {
        this->setDevice(_file);
        _good = true;
    }
    else
    {
        _good = false;
    }
}

bool TextFile::good()
{
    return _good;
}

bool TextFile::eof()
{
    if (!_good || this->atEnd()) return true;
    return false;
}

TextFile::~TextFile()
{
    _file->close();
    delete _file;
}