[Scummvm-cvs-logs] SF.net SVN: scummvm: [27113] scummvm/branches/gsoc2007-fsnode

david_corrales at users.sourceforge.net david_corrales at users.sourceforge.net
Tue Jun 5 23:02:36 CEST 2007


Revision: 27113
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27113&view=rev
Author:   david_corrales
Date:     2007-06-05 14:02:35 -0700 (Tue, 05 Jun 2007)

Log Message:
-----------
Renamed methods in the FilesystemNode class to match the AbstractFSNode implementations.
Also exposed the new methods (exists, isReadable and isWritable) in FilesystemNode.

Modified Paths:
--------------
    scummvm/branches/gsoc2007-fsnode/backends/fs/abstract-fs.h
    scummvm/branches/gsoc2007-fsnode/backends/plugins/dc/dc-provider.cpp
    scummvm/branches/gsoc2007-fsnode/backends/plugins/posix/posix-provider.cpp
    scummvm/branches/gsoc2007-fsnode/backends/plugins/sdl/sdl-provider.cpp
    scummvm/branches/gsoc2007-fsnode/backends/plugins/win32/win32-provider.cpp
    scummvm/branches/gsoc2007-fsnode/base/commandLine.cpp
    scummvm/branches/gsoc2007-fsnode/common/advancedDetector.cpp
    scummvm/branches/gsoc2007-fsnode/common/file.cpp
    scummvm/branches/gsoc2007-fsnode/common/fs.cpp
    scummvm/branches/gsoc2007-fsnode/common/fs.h
    scummvm/branches/gsoc2007-fsnode/common/md5.cpp
    scummvm/branches/gsoc2007-fsnode/engines/agi/agi_v3.cpp
    scummvm/branches/gsoc2007-fsnode/engines/agi/detection.cpp
    scummvm/branches/gsoc2007-fsnode/engines/kyra/resource.cpp
    scummvm/branches/gsoc2007-fsnode/engines/queen/queen.cpp
    scummvm/branches/gsoc2007-fsnode/engines/scumm/detection.cpp
    scummvm/branches/gsoc2007-fsnode/engines/sky/sky.cpp
    scummvm/branches/gsoc2007-fsnode/engines/sword1/sword1.cpp
    scummvm/branches/gsoc2007-fsnode/engines/sword2/sword2.cpp
    scummvm/branches/gsoc2007-fsnode/gui/browser.cpp
    scummvm/branches/gsoc2007-fsnode/gui/launcher.cpp
    scummvm/branches/gsoc2007-fsnode/gui/massadd.cpp
    scummvm/branches/gsoc2007-fsnode/gui/options.cpp
    scummvm/branches/gsoc2007-fsnode/gui/themebrowser.cpp

Modified: scummvm/branches/gsoc2007-fsnode/backends/fs/abstract-fs.h
===================================================================
--- scummvm/branches/gsoc2007-fsnode/backends/fs/abstract-fs.h	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/backends/fs/abstract-fs.h	2007-06-05 21:02:35 UTC (rev 27113)
@@ -79,7 +79,7 @@
 	virtual ~AbstractFilesystemNode() {}
 
 	/*
-	 * Indicates whether this path exists in the filesystem or not.
+	 * Indicates whether the object refered by this path exists in the filesystem or not.
 	 */
 	virtual bool exists() const = 0;
 

Modified: scummvm/branches/gsoc2007-fsnode/backends/plugins/dc/dc-provider.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/backends/plugins/dc/dc-provider.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/backends/plugins/dc/dc-provider.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -114,14 +114,14 @@
 	// Scan for all plugins in this directory
 	FilesystemNode dir(PLUGIN_DIRECTORY);
 	FSList files;
-	if (!dir.listDir(files, FilesystemNode::kListFilesOnly)) {
+	if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
 		error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
 	}
 
 	for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
-		Common::String name(i->name());
+		Common::String name(i->getName());
 		if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
-			pl.push_back(new DCPlugin(i->path()));
+			pl.push_back(new DCPlugin(i->getPath()));
 		}
 	}
 	

Modified: scummvm/branches/gsoc2007-fsnode/backends/plugins/posix/posix-provider.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/backends/plugins/posix/posix-provider.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/backends/plugins/posix/posix-provider.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -107,14 +107,14 @@
 	// Scan for all plugins in this directory
 	FilesystemNode dir(PLUGIN_DIRECTORY);
 	FSList files;
-	if (!dir.listDir(files, FilesystemNode::kListFilesOnly)) {
+	if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
 		error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
 	}
 
 	for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
-		Common::String name(i->name());
+		Common::String name(i->getName());
 		if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
-			pl.push_back(new POSIXPlugin(i->path()));
+			pl.push_back(new POSIXPlugin(i->getPath()));
 		}
 	}
 	

Modified: scummvm/branches/gsoc2007-fsnode/backends/plugins/sdl/sdl-provider.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/backends/plugins/sdl/sdl-provider.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/backends/plugins/sdl/sdl-provider.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -107,14 +107,14 @@
 	// Scan for all plugins in this directory
 	FilesystemNode dir(PLUGIN_DIRECTORY);
 	FSList files;
-	if (!dir.listDir(files, FilesystemNode::kListFilesOnly)) {
+	if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
 		error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
 	}
 
 	for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
-		Common::String name(i->name());
+		Common::String name(i->getName());
 		if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
-			pl.push_back(new SDLPlugin(i->path()));
+			pl.push_back(new SDLPlugin(i->getPath()));
 		}
 	}
 	

Modified: scummvm/branches/gsoc2007-fsnode/backends/plugins/win32/win32-provider.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/backends/plugins/win32/win32-provider.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/backends/plugins/win32/win32-provider.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -110,14 +110,14 @@
 	// Scan for all plugins in this directory
 	FilesystemNode dir(PLUGIN_DIRECTORY);
 	FSList files;
-	if (!dir.listDir(files, FilesystemNode::kListFilesOnly)) {
+	if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
 		error("Couldn't open plugin directory '%s'", PLUGIN_DIRECTORY);
 	}
 
 	for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
-		Common::String name(i->name());
+		Common::String name(i->getName());
 		if (name.hasPrefix(PLUGIN_PREFIX) && name.hasSuffix(PLUGIN_SUFFIX)) {
-			pl.push_back(new Win32Plugin(i->path()));
+			pl.push_back(new Win32Plugin(i->getPath()));
 		}
 	}
 	

Modified: scummvm/branches/gsoc2007-fsnode/base/commandLine.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/base/commandLine.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/base/commandLine.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -562,7 +562,7 @@
 		
 		FilesystemNode dir(path);
 		FSList files;
-		if (!dir.listDir(files, FilesystemNode::kListAll)) {
+		if (!dir.getChildren(files, FilesystemNode::kListAll)) {
 			printf(" ... invalid path, skipping\n");
 			continue;
 		}

Modified: scummvm/branches/gsoc2007-fsnode/common/advancedDetector.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/common/advancedDetector.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/common/advancedDetector.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -227,7 +227,7 @@
 
 	FSList fslist;
 	FilesystemNode dir(ConfMan.get("path"));
-	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+	if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
 		return kInvalidPathError;
 	}
 
@@ -285,7 +285,7 @@
 		// Get the information of the existing files
 		for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
 			if (file->isDirectory()) continue;
-			tstr = file->name();
+			tstr = file->getName();
 			tstr.toLowercase();
 
 			// Strip any trailing dot
@@ -304,7 +304,7 @@
 
 			debug(3, "> %s: %s", tstr.c_str(), md5str);
 
-			if (testFile.open(file->path())) {
+			if (testFile.open(file->getPath())) {
 				filesSize[tstr] = (int32)testFile.size();
 				testFile.close();
 			}

Modified: scummvm/branches/gsoc2007-fsnode/common/file.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/common/file.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/common/file.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -226,7 +226,7 @@
 		return;
 
 	FSList fslist;
-	if (!dir.listDir(fslist, FilesystemNode::kListAll)) {
+	if (!dir.getChildren(fslist, FilesystemNode::kListAll)) {
 		// Failed listing the contents of this node, so it is either not a 
 		// directory, or just doesn't exist at all.
 		return;
@@ -237,7 +237,7 @@
 
 	// Do not add directories multiple times, unless this time they are added
 	// with a bigger depth.
-	const String &directory(dir.path());
+	const String &directory(dir.getPath());
 	if (_defaultDirectories->contains(directory) && (*_defaultDirectories)[directory] >= level)
 		return;
 	(*_defaultDirectories)[directory] = level;
@@ -247,13 +247,13 @@
 
 	for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
 		if (file->isDirectory()) {
-			addDefaultDirectoryRecursive(file->path(), level - 1, prefix + file->name() + "/");
+			addDefaultDirectoryRecursive(file->getPath(), level - 1, prefix + file->getName() + "/");
 		} else {
 			String lfn(prefix);
-			lfn += file->name();
+			lfn += file->getName();
 			lfn.toLowercase();
 			if (!_filesMap->contains(lfn)) {
-				(*_filesMap)[lfn] = file->path();
+				(*_filesMap)[lfn] = file->getPath();
 			}
 		}
 	}
@@ -372,7 +372,7 @@
 		return false;
 	}
 
-	String filename(node.name());
+	String filename(node.getName());
 
 	if (_handle) {
 		error("File::open: This file object already is opened (%s), won't open '%s'", _name.c_str(), filename.c_str());
@@ -383,7 +383,7 @@
 
 	const char *modeStr = (mode == kFileReadMode) ? "rb" : "wb";
 
-	_handle = fopen(node.path().c_str(), modeStr);
+	_handle = fopen(node.getPath().c_str(), modeStr);
 
 	if (_handle == NULL) {
 		if (mode == kFileReadMode)

Modified: scummvm/branches/gsoc2007-fsnode/common/fs.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/common/fs.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/common/fs.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -27,16 +27,16 @@
 #include "backends/fs/abstract-fs.h"
 #include "backends/fs/fs-factory-maker.cpp"
 
+FilesystemNode::FilesystemNode() {
+	_realNode = 0;
+	_refCount = 0;
+}
+
 FilesystemNode::FilesystemNode(AbstractFilesystemNode *realNode) {
 	_realNode = realNode;
 	_refCount = new int(1);
 }
 
-FilesystemNode::FilesystemNode() {
-	_realNode = 0;
-	_refCount = 0;
-}
-
 FilesystemNode::FilesystemNode(const FilesystemNode &node) {
 	_realNode = node._realNode;
 	_refCount = node._refCount;
@@ -58,17 +58,6 @@
 	decRefCount();
 }
 
-void FilesystemNode::decRefCount() {
-	if (_refCount) {
-		assert(*_refCount > 0);
-		--(*_refCount);
-		if (*_refCount == 0) {
-			delete _refCount;
-			delete _realNode;
-		}
-	}
-}
-
 FilesystemNode &FilesystemNode::operator= (const FilesystemNode &node) {
 	if (node._refCount)
 		++(*node._refCount);
@@ -81,24 +70,32 @@
 	return *this;
 }
 
-bool FilesystemNode::isValid() const {
-	if (_realNode == 0)
+bool FilesystemNode::operator< (const FilesystemNode& node) const
+{
+	if (isDirectory() && !node.isDirectory())
+		return true;
+	if (!isDirectory() && node.isDirectory())
 		return false;
-	return _realNode->isValid();
+	return scumm_stricmp(getDisplayName().c_str(), node.getDisplayName().c_str()) < 0;
 }
 
-FilesystemNode FilesystemNode::getParent() const {
-	if (_realNode == 0)
-		return *this;
-
-	AbstractFilesystemNode *node = _realNode->getParent();
-	if (node == 0) {
-		return *this;
-	} else {
-		return FilesystemNode(node);
+void FilesystemNode::decRefCount() {
+	if (_refCount) {
+		assert(*_refCount > 0);
+		--(*_refCount);
+		if (*_refCount == 0) {
+			delete _refCount;
+			delete _realNode;
+		}
 	}
 }
 
+bool FilesystemNode::exists() const {
+	if (_realNode == 0)
+		return false;
+	return _realNode->exists();
+}
+
 FilesystemNode FilesystemNode::getChild(const Common::String &n) const {
 	if (_realNode == 0)
 		return *this;
@@ -108,7 +105,7 @@
 	return FilesystemNode(node);
 }
 
-bool FilesystemNode::listDir(FSList &fslist, ListMode mode) const {
+bool FilesystemNode::getChildren(FSList &fslist, ListMode mode) const {
 	if (!_realNode || !_realNode->isDirectory())
 		return false;
 
@@ -125,32 +122,53 @@
 	return true;
 }
 
-bool FilesystemNode::isDirectory() const {
-	if (_realNode == 0)
-		return false;
-	return _realNode->isDirectory();
-}
-
-Common::String FilesystemNode::displayName() const {
+Common::String FilesystemNode::getDisplayName() const {
 	assert(_realNode);
 	return _realNode->getDisplayName();
 }
 
-Common::String FilesystemNode::name() const {
+Common::String FilesystemNode::getName() const {
 	assert(_realNode);
 	return _realNode->getName();
 }
 
-Common::String FilesystemNode::path() const {
+FilesystemNode FilesystemNode::getParent() const {
+	if (_realNode == 0)
+		return *this;
+
+	AbstractFilesystemNode *node = _realNode->getParent();
+	if (node == 0) {
+		return *this;
+	} else {
+		return FilesystemNode(node);
+	}
+}
+
+Common::String FilesystemNode::getPath() const {
 	assert(_realNode);
 	return _realNode->getPath();
 }
 
-bool FilesystemNode::operator< (const FilesystemNode& node) const
-{
-	if (isDirectory() && !node.isDirectory())
-		return true;
-	if (!isDirectory() && node.isDirectory())
+bool FilesystemNode::isDirectory() const {
+	if (_realNode == 0)
 		return false;
-	return scumm_stricmp(displayName().c_str(), node.displayName().c_str()) < 0;
+	return _realNode->isDirectory();
 }
+
+bool FilesystemNode::isReadable() const {
+	if (_realNode == 0)
+		return false;
+	return _realNode->isReadable();
+}
+
+bool FilesystemNode::isValid() const {
+	if (_realNode == 0)
+		return false;
+	return _realNode->isValid();
+}
+
+bool FilesystemNode::isWritable() const {
+	if (_realNode == 0)
+		return false;
+	return _realNode->isWritable();
+}

Modified: scummvm/branches/gsoc2007-fsnode/common/fs.h
===================================================================
--- scummvm/branches/gsoc2007-fsnode/common/fs.h	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/common/fs.h	2007-06-05 21:02:35 UTC (rev 27113)
@@ -119,19 +119,35 @@
 	 */
 	bool operator< (const FilesystemNode& node) const;
 
+	/*
+	 * Indicates whether the object refered by this path exists in the filesystem or not.
+	 */
+	virtual bool exists() const;
+
 	/**
+	 * Fetch a child node of this node, with the given name. Only valid for
+	 * directory nodes (an assertion is triggered otherwise).
+	 * If no child node with the given name exists, an invalid node is returned.
+	 */
+	FilesystemNode getChild(const Common::String &name) const;
+	
+	/**
+	 * Return a list of child nodes of this directory node. If called on a node
+	 * that does not represent a directory, false is returned.
+	 * 
+	 * @return true if succesful, false otherwise (e.g. when the directory does not exist).
+	 * @todo Rename this to listChildren or getChildren.
+	 */
+	virtual bool getChildren(FSList &fslist, ListMode mode = kListDirectoriesOnly) const;	
+
+	/**
 	 * Return a human readable string for this node, usable for display (e.g.
 	 * in the GUI code). Do *not* rely on it being usable for anything else,
 	 * like constructing paths!
 	 * @return the display name
 	 */
-	virtual Common::String displayName() const;
+	virtual Common::String getDisplayName() const;
 
-	/*
-	 * Indicates whether the object refered by this path exists in the filesystem or not.
-	 */
-	virtual bool exists() const;
-
 	/**
 	 * Return a string representation of the name of the file. This is can be
 	 * used e.g. by detection code that relies on matching the name of a given
@@ -140,7 +156,7 @@
 	 *
 	 * @return the file name
 	 */
-	virtual Common::String name() const;
+	virtual Common::String getName() const;
 
 	/**
 	 * Return a string representation of the file which can be passed to fopen(),
@@ -153,25 +169,9 @@
 	 *
 	 * @return the 'path' represented by this filesystem node
 	 */
-	virtual Common::String path() const;
-
-	/**
-	 * Fetch a child node of this node, with the given name. Only valid for
-	 * directory nodes (an assertion is triggered otherwise).
-	 * If no child node with the given name exists, an invalid node is returned.
-	 */
-	FilesystemNode getChild(const Common::String &name) const;
+	virtual Common::String getPath() const;
 	
 	/**
-	 * Return a list of child nodes of this directory node. If called on a node
-	 * that does not represent a directory, false is returned.
-	 * 
-	 * @return true if succesful, false otherwise (e.g. when the directory does not exist).
-	 * @todo Rename this to listChildren or getChildren.
-	 */
-	virtual bool listDir(FSList &fslist, ListMode mode = kListDirectoriesOnly) const;	
-	
-	/**
 	 * Get the parent node of this node. If this node has no parent node,
 	 * then it returns a duplicate of this node.
 	 */

Modified: scummvm/branches/gsoc2007-fsnode/common/md5.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/common/md5.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/common/md5.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -254,7 +254,7 @@
 		return false;
 	}
 
-	return md5_file(file.path().c_str(), digest, length);
+	return md5_file(file.getPath().c_str(), digest, length);
 }
 
 bool md5_file(const char *name, uint8 digest[16], uint32 length) {

Modified: scummvm/branches/gsoc2007-fsnode/engines/agi/agi_v3.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/agi/agi_v3.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/agi/agi_v3.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -52,14 +52,14 @@
 	FSList fslist;
 	FilesystemNode dir(ConfMan.get("path"));
 
-	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
-		warning("AgiEngine: invalid game path '%s'", dir.path().c_str());
+	if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
+		warning("AgiEngine: invalid game path '%s'", dir.getPath().c_str());
 		return errInvalidAGIFile;
 	}
 
 	for (FSList::const_iterator file = fslist.begin();
 	    file != fslist.end() && !found; ++file) {
-		Common::String f = file->name();
+		Common::String f = file->getName();
 		f.toLowercase();
 
 		if (f.hasSuffix("vol.0")) {

Modified: scummvm/branches/gsoc2007-fsnode/engines/agi/detection.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/agi/detection.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/agi/detection.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -1885,7 +1885,7 @@
 	// First grab all filenames
 	for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
 		if (file->isDirectory()) continue;
-		tstr = file->name();
+		tstr = file->getName();
 		tstr.toLowercase();
 
 		allFiles[tstr] = true;

Modified: scummvm/branches/gsoc2007-fsnode/engines/kyra/resource.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/kyra/resource.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/kyra/resource.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -82,8 +82,8 @@
 	FSList fslist;
 	FilesystemNode dir(ConfMan.get("path"));
 
-	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly))
-		error("invalid game path '%s'", dir.path().c_str());
+	if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly))
+		error("invalid game path '%s'", dir.getPath().c_str());
 
 	if (_vm->game() == GI_KYRA1 && _vm->gameFlags().isTalkie) {
 		static const char *list[] = {
@@ -96,7 +96,7 @@
 		Common::for_each(_pakfiles.begin(), _pakfiles.end(), Common::bind2nd(Common::mem_fun(&ResourceFile::protect), true));
 	} else {
 		for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
-			Common::String filename = file->name();
+			Common::String filename = file->getName();
 			filename.toUppercase();
 
 			// No real PAK file!
@@ -104,8 +104,8 @@
 				continue;
 
 			if (filename.hasSuffix("PAK") || filename.hasSuffix("APK")) {
-				if (!loadPakFile(file->name()))
-					error("couldn't open pakfile '%s'", file->name().c_str());
+				if (!loadPakFile(file->getName()))
+					error("couldn't open pakfile '%s'", file->getName().c_str());
 			}
 		}
 

Modified: scummvm/branches/gsoc2007-fsnode/engines/queen/queen.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/queen/queen.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/queen/queen.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -73,7 +73,7 @@
 		if (file->isDirectory()) {
 			continue;
 		}
-		if (file->name().equalsIgnoreCase("queen.1") || file->name().equalsIgnoreCase("queen.1c")) {
+		if (file->getName().equalsIgnoreCase("queen.1") || file->getName().equalsIgnoreCase("queen.1c")) {
 			Common::File dataFile;
 			if (!dataFile.open(*file)) {
 				continue;

Modified: scummvm/branches/gsoc2007-fsnode/engines/scumm/detection.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/scumm/detection.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/scumm/detection.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -205,7 +205,7 @@
 // the first match is used.
 static bool searchFSNode(const FSList &fslist, const Common::String &name, FilesystemNode &result) {
 	for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
-		if (!scumm_stricmp(file->name().c_str(), name.c_str())) {
+		if (!scumm_stricmp(file->getName().c_str(), name.c_str())) {
 			result = *file;
 			return true;
 		}
@@ -231,7 +231,7 @@
 		FSList tmpList;
 		if (searchFSNode(fslist, "RESOURCE", resDir)
 			&& resDir.isDirectory()
-			&& resDir.listDir(tmpList, FilesystemNode::kListFilesOnly)
+			&& resDir.getChildren(tmpList, FilesystemNode::kListFilesOnly)
 			&& searchFSNode(tmpList, filename, langFile)) {
 			tmp.open(langFile);
 		}
@@ -328,7 +328,7 @@
 			DetectorDesc d;
 			d.node = *file;
 			d.md5Entry = 0;
-			fileMD5Map[file->name()] = d;
+			fileMD5Map[file->getName()] = d;
 		}
 	}
 
@@ -455,7 +455,7 @@
 
 	Common::File tmp;
 	if (!tmp.open(d.node)) {
-		warning("SCUMM detectGames: failed to open '%s' for read access", d.node.path().c_str());
+		warning("SCUMM detectGames: failed to open '%s' for read access", d.node.getPath().c_str());
 		return false;
 	}
 	
@@ -784,7 +784,7 @@
 	// Fetch the list of files in the current directory
 	FSList fslist;
 	FilesystemNode dir(ConfMan.get("path"));
-	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+	if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
 		return kInvalidPathError;
 	}
 

Modified: scummvm/branches/gsoc2007-fsnode/engines/sky/sky.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/sky/sky.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/sky/sky.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -124,11 +124,11 @@
 	// Iterate over all files in the given directory
 	for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
 		if (!file->isDirectory()) {
-			const char *fileName = file->name().c_str();
+			const char *fileName = file->getName().c_str();
 
 			if (0 == scumm_stricmp("sky.dsk", fileName)) {
 				Common::File dataDisk;
-				if (dataDisk.open(file->path())) {
+				if (dataDisk.open(file->getPath())) {
 					hasSkyDsk = true;
 					dataDiskSize = dataDisk.size();
 				}
@@ -136,7 +136,7 @@
 
 			if (0 == scumm_stricmp("sky.dnr", fileName)) {
 				Common::File dinner;
-				if (dinner.open(file->path())) {
+				if (dinner.open(file->getPath())) {
 					hasSkyDnr = true;
 					dinnerTableEntries = dinner.readUint32LE();
 				}

Modified: scummvm/branches/gsoc2007-fsnode/engines/sword1/sword1.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/sword1/sword1.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/sword1/sword1.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -107,15 +107,15 @@
 void Sword1CheckDirectory(const FSList &fslist, bool *filesFound) {
 	for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
 		if (!file->isDirectory()) {
-			const char *fileName = file->name().c_str();
+			const char *fileName = file->getName().c_str();
 			for (int cnt = 0; cnt < NUM_FILES_TO_CHECK; cnt++)
 				if (scumm_stricmp(fileName, g_filesToCheck[cnt]) == 0)
 					filesFound[cnt] = true;
 		} else {
 			for (int cnt = 0; cnt < ARRAYSIZE(g_dirNames); cnt++)
-				if (scumm_stricmp(file->name().c_str(), g_dirNames[cnt]) == 0) {
+				if (scumm_stricmp(file->getName().c_str(), g_dirNames[cnt]) == 0) {
 					FSList fslist2;
-					if (file->listDir(fslist2, FilesystemNode::kListFilesOnly))
+					if (file->getChildren(fslist2, FilesystemNode::kListFilesOnly))
 						Sword1CheckDirectory(fslist2, filesFound);
 				}
 		}

Modified: scummvm/branches/gsoc2007-fsnode/engines/sword2/sword2.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/engines/sword2/sword2.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/engines/sword2/sword2.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -101,7 +101,7 @@
 		// Iterate over all files in the given directory
 		for (file = fslist.begin(); file != fslist.end(); ++file) {
 			if (!file->isDirectory()) {
-				const char *fileName = file->name().c_str();
+				const char *fileName = file->getName().c_str();
 
 				if (0 == scumm_stricmp(g->detectname, fileName)) {
 					// Match found, add to list of candidates, then abort inner loop.
@@ -118,11 +118,11 @@
 		// present e.g. if the user copied the data straight from CD.
 		for (file = fslist.begin(); file != fslist.end(); ++file) {
 			if (file->isDirectory()) {
-				const char *fileName = file->name().c_str();
+				const char *fileName = file->getName().c_str();
 
 				if (0 == scumm_stricmp("clusters", fileName)) {
 					FSList recList;
-					if (file->listDir(recList, FilesystemNode::kListAll)) {
+					if (file->getChildren(recList, FilesystemNode::kListAll)) {
 						GameList recGames(Engine_SWORD2_detectGames(recList));
 						if (!recGames.empty()) {
 							detectedGames.push_back(recGames);
@@ -144,7 +144,7 @@
 
 	FSList fslist;
 	FilesystemNode dir(ConfMan.get("path"));
-	if (!dir.listDir(fslist, FilesystemNode::kListAll)) {
+	if (!dir.getChildren(fslist, FilesystemNode::kListAll)) {
 		return kInvalidPathError;
 	}
 

Modified: scummvm/branches/gsoc2007-fsnode/gui/browser.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/gui/browser.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/gui/browser.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -222,15 +222,15 @@
 
 void BrowserDialog::updateListing() {
 	// Update the path display
-	_currentPath->setLabel(_node.path());
+	_currentPath->setLabel(_node.getPath());
 
 	// We memorize the last visited path.
-	ConfMan.set("browser_lastpath", _node.path());
+	ConfMan.set("browser_lastpath", _node.getPath());
 
 	// Read in the data from the file system
 	FilesystemNode::ListMode listMode = _isDirBrowser ? FilesystemNode::kListDirectoriesOnly
 	                                                  : FilesystemNode::kListAll;
-	if (!_node.listDir(_nodeContent, listMode)) {
+	if (!_node.getChildren(_nodeContent, listMode)) {
 		_nodeContent.clear();
 	} else {
 		Common::sort(_nodeContent.begin(), _nodeContent.end());
@@ -240,9 +240,9 @@
 	Common::StringList list;
 	for (FSList::iterator i = _nodeContent.begin(); i != _nodeContent.end(); ++i) {
 		if (!_isDirBrowser && i->isDirectory())
-			list.push_back(i->displayName() + "/");
+			list.push_back(i->getDisplayName() + "/");
 		else
-			list.push_back(i->displayName());
+			list.push_back(i->getDisplayName());
 	}
 	_fileList->setList(list);
 	_fileList->scrollTo(0);

Modified: scummvm/branches/gsoc2007-fsnode/gui/launcher.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/gui/launcher.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/gui/launcher.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -405,9 +405,9 @@
 		if (browser.runModal() > 0) {
 			// User made this choice...
 			FilesystemNode file(browser.getResult());
-			_soundFont->setLabel(file.path());
+			_soundFont->setLabel(file.getPath());
 
-			if (!file.path().empty() && (file.path() != "None"))
+			if (!file.getPath().empty() && (file.getPath() != "None"))
 				_soundFontClearButton->setEnabled(true);
 			else
 				_soundFontClearButton->setEnabled(false);
@@ -428,7 +428,7 @@
 			// done with optional specific gameid to pluginmgr detectgames?
 			// FSList files = dir.listDir(FilesystemNode::kListFilesOnly);
 
-			_gamePathWidget->setLabel(dir.path());
+			_gamePathWidget->setLabel(dir.getPath());
 			draw();
 		}
 		draw();
@@ -441,7 +441,7 @@
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			FilesystemNode dir(browser.getResult());
-			_extraPathWidget->setLabel(dir.path());
+			_extraPathWidget->setLabel(dir.getPath());
 			draw();
 		}
 		draw();
@@ -453,7 +453,7 @@
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			FilesystemNode dir(browser.getResult());
-			_savePathWidget->setLabel(dir.path());
+			_savePathWidget->setLabel(dir.getPath());
 			draw();
 		}
 		draw();
@@ -654,9 +654,9 @@
 		// User made his choice...
 		FilesystemNode dir(_browser->getResult());
 		FSList files;
-		if (!dir.listDir(files, FilesystemNode::kListAll)) {
+		if (!dir.getChildren(files, FilesystemNode::kListAll)) {
 			error("browser returned a node that is not a directory: '%s'",
-					dir.path().c_str());
+					dir.getPath().c_str());
 		}
 
 		// ...so let's determine a list of candidates, games that
@@ -686,7 +686,7 @@
 			GameDescriptor result = candidates[idx];
 
 			// TODO: Change the detectors to set "path" !
-			result["path"] = dir.path();
+			result["path"] = dir.getPath();
 
 			Common::String domain = addGameToConf(result);
 

Modified: scummvm/branches/gsoc2007-fsnode/gui/massadd.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/gui/massadd.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/gui/massadd.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -127,9 +127,9 @@
 		FilesystemNode dir = _scanStack.pop();
 	
 		FSList files;
-		if (!dir.listDir(files, FilesystemNode::kListAll)) {
+		if (!dir.getChildren(files, FilesystemNode::kListAll)) {
 			error("browser returned a node that is not a directory: '%s'",
-					dir.path().c_str());
+					dir.getPath().c_str());
 		}
 	
 		// Run the detector on the dir
@@ -141,7 +141,7 @@
 			// e.g. ask the user which one to pick (make sure to display the 
 			// path, too).
 			GameDescriptor result = candidates[0];
-			result["path"] = dir.path();
+			result["path"] = dir.getPath();
 			
 			_games.push_back(result);
 		}

Modified: scummvm/branches/gsoc2007-fsnode/gui/options.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/gui/options.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/gui/options.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -821,7 +821,7 @@
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			FilesystemNode dir(browser.getResult());
-			_savePath->setLabel(dir.path());
+			_savePath->setLabel(dir.getPath());
 			draw();
 			// TODO - we should check if the directory is writeable before accepting it
 		}
@@ -832,7 +832,7 @@
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			FilesystemNode dir(browser.getResult());
-			_themePath->setLabel(dir.path());
+			_themePath->setLabel(dir.getPath());
 			draw();
 		}
 		break;
@@ -842,7 +842,7 @@
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			FilesystemNode dir(browser.getResult());
-			_extraPath->setLabel(dir.path());
+			_extraPath->setLabel(dir.getPath());
 			draw();
 		}
 		break;
@@ -852,9 +852,9 @@
 		if (browser.runModal() > 0) {
 			// User made his choice...
 			FilesystemNode file(browser.getResult());
-			_soundFont->setLabel(file.path());
+			_soundFont->setLabel(file.getPath());
 
-			if (!file.path().empty() && (file.path() != "None"))
+			if (!file.getPath().empty() && (file.getPath() != "None"))
 				_soundFontClearButton->setEnabled(true);
 			else
 				_soundFontClearButton->setEnabled(false);

Modified: scummvm/branches/gsoc2007-fsnode/gui/themebrowser.cpp
===================================================================
--- scummvm/branches/gsoc2007-fsnode/gui/themebrowser.cpp	2007-06-05 19:06:54 UTC (rev 27112)
+++ scummvm/branches/gsoc2007-fsnode/gui/themebrowser.cpp	2007-06-05 21:02:35 UTC (rev 27113)
@@ -148,12 +148,12 @@
 		return;
 
 	FSList fslist;
-	if (!node.listDir(fslist, FilesystemNode::kListAll))
+	if (!node.getChildren(fslist, FilesystemNode::kListAll))
 		return;
 
 	for (FSList::const_iterator i = fslist.begin(); i != fslist.end(); ++i) {
 		if (i->isDirectory()) {
-			addDir(list, i->path(), level-1);
+			addDir(list, i->getPath(), level-1);
 		} else {
 			Entry th;
 			if (isTheme(*i, th)) {
@@ -176,7 +176,7 @@
 	Common::ConfigFile cfg;
 	Common::String type;
 
-	out.file = node.name();
+	out.file = node.getName();
 	for (int i = out.file.size()-1; out.file[i] != '.' && i > 0; --i) {
 		out.file.deleteLastChar();
 	}


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