summaryrefslogtreecommitdiffstats
path: root/src/util/TextFile.cpp
diff options
context:
space:
mode:
authorSebastian2010-05-12 19:42:27 +0200
committerSebastian2010-05-12 19:42:27 +0200
commitce3329047d378a14006ce74ec273ac59e3375303 (patch)
tree782430f270b4c7aca1b35d5b7813518e3797c555 /src/util/TextFile.cpp
downloadpvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.gz
pvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.xz
pvs-ce3329047d378a14006ce74ec273ac59e3375303.zip
initial import of latest svn version
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;
+}