diff options
author | Max Horn | 2008-10-11 22:11:02 +0000 |
---|---|---|
committer | Max Horn | 2008-10-11 22:11:02 +0000 |
commit | 8920f6849c8d4d6d7fbfeffe4708da3d68b0ab7c (patch) | |
tree | ce99c5ff64e64f082dada50efd612331a9d3369b | |
parent | ce7ffc4d0e89684b6e6a11d0f175a91e27e4ced4 (diff) | |
download | scummvm-rg350-8920f6849c8d4d6d7fbfeffe4708da3d68b0ab7c.tar.gz scummvm-rg350-8920f6849c8d4d6d7fbfeffe4708da3d68b0ab7c.tar.bz2 scummvm-rg350-8920f6849c8d4d6d7fbfeffe4708da3d68b0ab7c.zip |
Changed XMLParser to use SearchMan / FSNode::openForReading
svn-id: r34773
-rw-r--r-- | common/xmlparser.h | 22 |
1 files changed, 6 insertions, 16 deletions
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; } /** |