[Scummvm-cvs-logs] SF.net SVN: scummvm:[34773] scummvm/trunk/common/xmlparser.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Oct 12 00:11:02 CEST 2008


Revision: 34773
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34773&view=rev
Author:   fingolfin
Date:     2008-10-11 22:11:02 +0000 (Sat, 11 Oct 2008)

Log Message:
-----------
Changed XMLParser to use SearchMan / FSNode::openForReading

Modified Paths:
--------------
    scummvm/trunk/common/xmlparser.h

Modified: scummvm/trunk/common/xmlparser.h
===================================================================
--- scummvm/trunk/common/xmlparser.h	2008-10-11 21:39:24 UTC (rev 34772)
+++ scummvm/trunk/common/xmlparser.h	2008-10-11 22:11:02 UTC (rev 34773)
@@ -189,28 +189,20 @@
 	 * @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 @@
 	}
 	
 	void close() {
-		if (_stream) {
-			delete _stream;
-			_stream = 0;
-		}
+		delete _stream;
+		_stream = 0;
 	}
 
 	/**


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list