summaryrefslogtreecommitdiff
path: root/quackleio
diff options
context:
space:
mode:
Diffstat (limited to 'quackleio')
-rw-r--r--quackleio/gcgio.cpp18
-rw-r--r--quackleio/gcgio.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/quackleio/gcgio.cpp b/quackleio/gcgio.cpp
index 9209be5..8f8112f 100644
--- a/quackleio/gcgio.cpp
+++ b/quackleio/gcgio.cpp
@@ -30,6 +30,24 @@ GCGIO::GCGIO()
{
}
+Quackle::Game *GCGIO::read(const QString &filename, int flags)
+{
+ QFile file(filename);
+ Quackle::Game *ret = new Quackle::Game;
+
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
+ {
+ UVcerr << "Could not open gcg " << QuackleIO::Util::qstringToString(filename) << endl;
+ return ret;
+ }
+
+ QTextStream in(&file);
+ ret = read(in, flags);
+ file.close();
+
+ return ret;
+}
+
Quackle::Game *GCGIO::read(QTextStream &stream, int flags)
{
Quackle::Game *ret = new Quackle::Game;
diff --git a/quackleio/gcgio.h b/quackleio/gcgio.h
index 477f84f..a219c9f 100644
--- a/quackleio/gcgio.h
+++ b/quackleio/gcgio.h
@@ -30,6 +30,7 @@ public:
GCGIO();
~GCGIO() {};
+ virtual Quackle::Game *read(const QString &filename, int flags);
virtual Quackle::Game *read(QTextStream &stream, int flags);
virtual bool canRead(QTextStream &stream) const;
virtual void write(const Quackle::Game &game, QTextStream &stream);