summaryrefslogtreecommitdiffstats
path: root/src/util/TextFile.cpp
blob: 0d04e47286b95e927e6791a59dabc21163872ce1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * 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;
}