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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Sep 2 18:35:21 CEST 2008


Revision: 34284
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34284&view=rev
Author:   fingolfin
Date:     2008-09-02 16:35:16 +0000 (Tue, 02 Sep 2008)

Log Message:
-----------
Change FilesystemNode::getChild to new desired behavior: namely, that it should return valid nodes even for names for which no child exists (yet?) -- mail to scummvm-devel pending

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

Modified: scummvm/trunk/common/fs.h
===================================================================
--- scummvm/trunk/common/fs.h	2008-09-02 15:19:31 UTC (rev 34283)
+++ scummvm/trunk/common/fs.h	2008-09-02 16:35:16 UTC (rev 34284)
@@ -107,17 +107,29 @@
 	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.
+	 * Create a new node referring to a child node of the current node, which
+	 * must be a directory node (an assertion is triggered otherwise).
+	 * If a child matching the name exists, a normal node for it is returned.
+	 * If no child with the name exists, a node for it is still returned,
+	 * but exists() will return 'false' for it. This node can however be used
+	 * to create a new file using the openForWriting() method.
+	 *
+	 * @todo If openForWriting() (or a hypothetical future mkdir() method) is used,
+	 *       this should affect what exists/isDirectory/isReadable/isWritable return
+	 *       for existing nodes. However, this is not the case for many existing
+	 *       FSNode implementations. Either fix those, or document that FSNodes
+	 *       can become 'stale'...
+	 *
+	 * @param name	the name of a child of this directory
+	 * @return the node referring to the child with the given name
 	 */
 	FilesystemNode getChild(const Common::String &name) const;
 
 	/**
-	 * Return a list of child nodes of this directory node. If called on a node
+	 * Return a list of all 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).
+	 * @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;
 


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