summaryrefslogtreecommitdiffstats
path: root/src/util/TextFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/TextFile.cpp')
-rw-r--r--src/util/TextFile.cpp39
1 files changed, 39 insertions, 0 deletions
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;
+}