From ce3329047d378a14006ce74ec273ac59e3375303 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 12 May 2010 19:42:27 +0200 Subject: initial import of latest svn version --- src/util/TextFile.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/util/TextFile.cpp (limited to 'src/util/TextFile.cpp') diff --git a/src/util/TextFile.cpp b/src/util/TextFile.cpp new file mode 100644 index 0000000..0d04e47 --- /dev/null +++ b/src/util/TextFile.cpp @@ -0,0 +1,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; +} -- cgit v1.2.3-55-g7522