From 8920f6849c8d4d6d7fbfeffe4708da3d68b0ab7c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 11 Oct 2008 22:11:02 +0000 Subject: Changed XMLParser to use SearchMan / FSNode::openForReading svn-id: r34773 --- common/xmlparser.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'common/xmlparser.h') diff --git a/common/xmlparser.h b/common/xmlparser.h index 5f649f517f..cd2580b448 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -189,28 +189,20 @@ public: * @param filename Name of the file to load. */ bool loadFile(const Common::String &filename) { - Common::File *f = new Common::File; - - if (!f->open(filename)) { - delete f; + _stream = SearchMan.openFile(filename); + if (!_stream) return false; - } _fileName = filename; - _stream = f; return true; } bool loadFile(const FSNode &node) { - Common::File *f = new Common::File; - - if (!f->open(node)) { - delete f; + _stream = node.openForReading(); + if (!_stream) return false; - } _fileName = node.getName(); - _stream = f; return true; } @@ -238,10 +230,8 @@ public: } void close() { - if (_stream) { - delete _stream; - _stream = 0; - } + delete _stream; + _stream = 0; } /** -- cgit v1.2.3