[Scummvm-cvs-logs] SF.net SVN: scummvm: [21801] scummvm/trunk/backends/fs/palmos/palmos-fs.cpp

chrilith at users.sourceforge.net chrilith at users.sourceforge.net
Tue Apr 11 11:14:00 CEST 2006


Revision: 21801
Author:   chrilith
Date:     2006-04-11 11:13:04 -0700 (Tue, 11 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21801&view=rev

Log Message:
-----------
Fixed FS support based on lastest changes to the base fs class

Modified Paths:
--------------
    scummvm/trunk/backends/fs/palmos/palmos-fs.cpp
Modified: scummvm/trunk/backends/fs/palmos/palmos-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/palmos/palmos-fs.cpp	2006-04-11 18:11:03 UTC (rev 21800)
+++ scummvm/trunk/backends/fs/palmos/palmos-fs.cpp	2006-04-11 18:13:04 UTC (rev 21801)
@@ -22,7 +22,7 @@
 #if defined(PALMOS_MODE)
 
 #include "common/stdafx.h"
-#include "backends/fs/fs.h"
+#include "fs/fs.h"
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -40,7 +40,8 @@
 	
 public:
 	PalmOSFilesystemNode();
-	PalmOSFilesystemNode(const Char *path);
+	PalmOSFilesystemNode(const PalmOSFilesystemNode &node);
+	PalmOSFilesystemNode(const String &path);
 
 	virtual String displayName() const { return _displayName; }
 	virtual bool isValid() const { return _isValid; }
@@ -54,17 +55,6 @@
 	static void addFile (FSList &list, ListMode mode, const Char *base, FileInfoType* find_data);
 };
 
-static const char *lastPathComponent(const Common::String &str) {
-	const char *start = str.c_str();
-	const char *cur = start + str.size() - 2;
-
-	while (cur > start && *cur != '/') {
-		--cur;
-	}
-
-	return cur + 1;
-}
-
 void PalmOSFilesystemNode::addFile(FSList &list, ListMode mode, const char *base, FileInfoType* find_data) {
 	PalmOSFilesystemNode entry;
 	bool isDirectory;
@@ -91,6 +81,11 @@
 	return new PalmOSFilesystemNode();
 }
 
+AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+	return new PalmOSFilesystemNode(path);
+}
+
+
 PalmOSFilesystemNode::PalmOSFilesystemNode() {
 	_isDirectory = true;
 	_displayName = "Root";
@@ -99,8 +94,28 @@
 	_isPseudoRoot = true;
 }
 
+PalmOSFilesystemNode::PalmOSFilesystemNode(const String &path) {
+	if (path.size() == 0)
+		_isPseudoRoot = true;
+	_path = path;
+	const char *dsplName = NULL, *pos = path.c_str();
+	while (*pos)
+		if (*pos++ == '/')
+			dsplName = pos;
+	_displayName = String(dsplName);
+	_isValid = true;
+	_isDirectory = true;
+}
+
+PalmOSFilesystemNode::PalmOSFilesystemNode(const PalmOSFilesystemNode &node) {
+	_displayName = node._displayName;
+	_isDirectory = node._isDirectory;
+	_isValid = node._isValid;
+	_isPseudoRoot = node._isPseudoRoot;
+	_path = node._path;
+}
+
 FSList PalmOSFilesystemNode::listDir(ListMode mode) const {
-
 	FSList myList;
 	Err e;
 	Char nameP[256];
@@ -127,6 +142,17 @@
 	return myList;
 }
 
+const char *lastPathComponent(const Common::String &str) {
+	const char *start = str.c_str();
+	const char *cur = start + str.size() - 2;
+
+	while (cur > start && *cur != '/') {
+		--cur;
+	}
+
+	return cur+1;
+}
+
 AbstractFilesystemNode *PalmOSFilesystemNode::parent() const {
 	PalmOSFilesystemNode *p = 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