[Scummvm-cvs-logs] SF.net SVN: scummvm:[48041] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Feb 13 12:57:01 CET 2010


Revision: 48041
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48041&view=rev
Author:   fingolfin
Date:     2010-02-13 11:57:01 +0000 (Sat, 13 Feb 2010)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/common/fs.cpp
    scummvm/trunk/common/fs.h

Modified: scummvm/trunk/common/fs.cpp
===================================================================
--- scummvm/trunk/common/fs.cpp	2010-02-13 11:56:30 UTC (rev 48040)
+++ scummvm/trunk/common/fs.cpp	2010-02-13 11:57:01 UTC (rev 48041)
@@ -49,17 +49,17 @@
 }
 
 bool FSNode::operator<(const FSNode& node) const {
+	// Directories come before files, i.e., are "lower".
 	if (isDirectory() != node.isDirectory())
 		return isDirectory();
 
+	// If both nodes are of the same type (two files or two dirs),
+	// then sort by name, ignoring case.
 	return getDisplayName().compareToIgnoreCase(node.getDisplayName()) < 0;
 }
 
 bool FSNode::exists() const {
-	if (_realNode == 0)
-		return false;
-
-	return _realNode->exists();
+	return _realNode && _realNode->exists();
 }
 
 FSNode FSNode::getChild(const Common::String &n) const {
@@ -116,24 +116,15 @@
 }
 
 bool FSNode::isDirectory() const {
-	if (_realNode == 0)
-		return false;
-
-	return _realNode->isDirectory();
+	return _realNode && _realNode->isDirectory();
 }
 
 bool FSNode::isReadable() const {
-	if (_realNode == 0)
-		return false;
-
-	return _realNode->isReadable();
+	return _realNode && _realNode->isReadable();
 }
 
 bool FSNode::isWritable() const {
-	if (_realNode == 0)
-		return false;
-
-	return _realNode->isWritable();
+	return _realNode && _realNode->isWritable();
 }
 
 Common::SeekableReadStream *FSNode::createReadStream() const {

Modified: scummvm/trunk/common/fs.h
===================================================================
--- scummvm/trunk/common/fs.h	2010-02-13 11:56:30 UTC (rev 48040)
+++ scummvm/trunk/common/fs.h	2010-02-13 11:57:01 UTC (rev 48041)
@@ -101,7 +101,7 @@
 	 *
 	 * @return bool true if the node exists, false otherwise.
 	 */
-	virtual bool exists() const;
+	bool exists() const;
 
 	/**
 	 * Create a new node referring to a child node of the current node, which
@@ -128,7 +128,7 @@
 	 *
 	 * @return true if successful, false otherwise (e.g. when the directory does not exist).
 	 */
-	virtual bool getChildren(FSList &fslist, ListMode mode = kListDirectoriesOnly, bool hidden = false) const;
+	bool getChildren(FSList &fslist, ListMode mode = kListDirectoriesOnly, bool hidden = false) const;
 
 	/**
 	 * Return a human readable string for this node, usable for display (e.g.
@@ -161,7 +161,7 @@
 	 *
 	 * @return the 'path' represented by this filesystem node
 	 */
-	virtual String getPath() const;
+	String getPath() const;
 
 	/**
 	 * Get the parent node of this node. If this node has no parent node,
@@ -178,7 +178,7 @@
 	 * Or even replace isDirectory by a getType() method that can return values like
 	 * kDirNodeType, kFileNodeType, kInvalidNodeType.
 	 */
-	virtual bool isDirectory() const;
+	bool isDirectory() const;
 
 	/**
 	 * Indicates whether the object referred by this node can be read from or not.
@@ -191,7 +191,7 @@
 	 *
 	 * @return true if the object can be read, false otherwise.
 	 */
-	virtual bool isReadable() const;
+	bool isReadable() const;
 
 	/**
 	 * Indicates whether the object referred by this node can be written to or not.
@@ -204,7 +204,7 @@
 	 *
 	 * @return true if the object can be written to, false otherwise.
 	 */
-	virtual bool isWritable() const;
+	bool isWritable() const;
 
 	/**
 	 * Creates a SeekableReadStream instance corresponding to the file
@@ -222,7 +222,7 @@
 	 *
 	 * @return pointer to the stream object, 0 in case of a failure
 	 */
-	virtual WriteStream *createWriteStream() const;
+	WriteStream *createWriteStream() const;
 };
 
 /**


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