[Scummvm-cvs-logs] SF.net SVN: scummvm:[34498] scummvm/trunk/backends/fs/symbian

anotherguest at users.sourceforge.net anotherguest at users.sourceforge.net
Thu Sep 11 23:32:40 CEST 2008


Revision: 34498
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34498&view=rev
Author:   anotherguest
Date:     2008-09-11 21:32:40 +0000 (Thu, 11 Sep 2008)

Log Message:
-----------
Added SymbianStream.h for SymbianStdioStream definition
Renamed Symbian stream implementation to
SymbianStdioStream instead of StdioStream.

Modified Paths:
--------------
    scummvm/trunk/backends/fs/symbian/symbian-fs.cpp
    scummvm/trunk/backends/fs/symbian/symbianstream.cpp

Added Paths:
-----------
    scummvm/trunk/backends/fs/symbian/symbianstream.h

Modified: scummvm/trunk/backends/fs/symbian/symbian-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/symbian/symbian-fs.cpp	2008-09-11 20:34:46 UTC (rev 34497)
+++ scummvm/trunk/backends/fs/symbian/symbian-fs.cpp	2008-09-11 21:32:40 UTC (rev 34498)
@@ -24,8 +24,8 @@
 
 #if defined (__SYMBIAN32__)
 #include "backends/fs/abstract-fs.h"
-#include "backends/fs/stdiostream.h"
-#include "backends/platform/symbian/src/SymbianOS.h"
+#include "backends/fs/symbian/symbianstream.h"
+#include "backends/platform/symbian/src/symbianos.h"
 
 #include <dirent.h>
 #include <eikenv.h>
@@ -253,11 +253,12 @@
 }
 
 Common::SeekableReadStream *SymbianFilesystemNode::openForReading() {
-	return StdioStream::makeFromPath(getPath().c_str(), false);
+	return SymbianStdioStream::makeFromPath(getPath().c_str(), false);
 }
 
 Common::WriteStream *SymbianFilesystemNode::openForWriting() {
-	return StdioStream::makeFromPath(getPath().c_str(), true);
+	return SymbianStdioStream::makeFromPath(getPath().c_str(), true);
 }
+#endif //#if defined (__SYMBIAN32__)
 
-#endif //#if defined (__SYMBIAN32__)
+

Modified: scummvm/trunk/backends/fs/symbian/symbianstream.cpp
===================================================================
--- scummvm/trunk/backends/fs/symbian/symbianstream.cpp	2008-09-11 20:34:46 UTC (rev 34497)
+++ scummvm/trunk/backends/fs/symbian/symbianstream.cpp	2008-09-11 21:32:40 UTC (rev 34498)
@@ -24,9 +24,9 @@
  */	
 
 #include "common/scummsys.h"
-#include "backends/fs/StdioStream.h"
+#include "backends/fs/symbian/symbianstream.h"
 #include "common/system.h"
-#include "backends/platform/symbian/src/SymbianOS.h"
+#include "backends/platform/symbian/src/symbianos.h"
 
 #include <f32file.h>
 
@@ -173,31 +173,31 @@
 	return pointer.Length() / size;
 }
 
-StdioStream::StdioStream(void *handle) : _handle(handle) {
+SymbianStdioStream::SymbianStdioStream(void *handle) : _handle(handle) {
 	assert(handle);
 }
 
-StdioStream::~StdioStream() {
+SymbianStdioStream::~SymbianStdioStream() {
 	((TSymbianFileEntry*)(_handle))->_fileHandle.Close();
 
 	delete (TSymbianFileEntry*)(_handle);
 }
 
-bool StdioStream::ioFailed() const {
+bool SymbianStdioStream::ioFailed() const {
 	return eos() || ((TSymbianFileEntry*)(_handle))->_lastError != 0;
 }
 
-void StdioStream::clearIOFailed() {
+void SymbianStdioStream::clearIOFailed() {
 	((TSymbianFileEntry*)(_handle))->_lastError = 0;
 }
 
-bool StdioStream::eos() const {
+bool SymbianStdioStream::eos() const {
 	TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle));
 
 	return entry->_eofReached != 0;
 }
 
-uint32 StdioStream::pos() const {
+uint32 SymbianStdioStream::pos() const {
 	TInt pos = 0;
 	TSymbianFileEntry* entry = ((TSymbianFileEntry*)(_handle));
 
@@ -210,7 +210,7 @@
 	return pos;
 }
 
-uint32 StdioStream::size() const {
+uint32 SymbianStdioStream::size() const {
 
 	TInt length = 0;
 	((TSymbianFileEntry*)(_handle))->_fileHandle.Size(length);
@@ -218,7 +218,7 @@
 	return length;
 }
 
-void StdioStream::seek(int32 offs, int whence) {
+void SymbianStdioStream::seek(int32 offs, int whence) {
 	assert(_handle);
 
 	TSeek seekMode = ESeekStart;
@@ -249,11 +249,11 @@
 	}	
 }
 
-uint32 StdioStream::read(void *ptr, uint32 len) {
+uint32 SymbianStdioStream::read(void *ptr, uint32 len) {
 	return (uint32)ReadData((byte *)ptr, 1, len, (TSymbianFileEntry *)_handle);
 }
 
-uint32 StdioStream::write(const void *ptr, uint32 len) {
+uint32 SymbianStdioStream::write(const void *ptr, uint32 len) {
 	TPtrC8 pointer( (unsigned char*) ptr, len);
 
 	((TSymbianFileEntry*)(_handle))->_inputPos = KErrNotFound;
@@ -267,14 +267,14 @@
 	return 0;
 }
 
-void StdioStream::flush() {
+void SymbianStdioStream::flush() {
 	((TSymbianFileEntry*)(_handle))->_fileHandle.Flush();
 }
 
-StdioStream *StdioStream::makeFromPath(const Common::String &path, bool writeMode) {
+SymbianStdioStream *SymbianStdioStream::makeFromPath(const Common::String &path, bool writeMode) {
 	void *handle = CreateSymbianFileEntry(path.c_str(), writeMode ? "wb" : "rb");
 	if (handle)
-		return new StdioStream(handle);
+		return new SymbianStdioStream(handle);
 	return 0;
 }
 

Added: scummvm/trunk/backends/fs/symbian/symbianstream.h
===================================================================
--- scummvm/trunk/backends/fs/symbian/symbianstream.h	                        (rev 0)
+++ scummvm/trunk/backends/fs/symbian/symbianstream.h	2008-09-11 21:32:40 UTC (rev 34498)
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: $
+ * $Id: $
+ *
+ */
+
+#ifndef BACKENDS_FS_SYMBIANSTDIOSTREAM_H
+#define BACKENDS_FS_SYMBIANSTDIOSTREAM_H
+
+#include "common/scummsys.h"
+#include "common/noncopyable.h"
+#include "common/stream.h"
+#include "common/str.h"
+
+class SymbianStdioStream : public Common::SeekableReadStream, public Common::WriteStream, public Common::NonCopyable {
+protected:
+	/** File handle to the actual file. */
+	void *_handle;
+
+public:
+	/**
+	 * Given a path, invokes fopen on that path and wrap the result in a
+	 * StdioStream instance.
+	 */
+	static SymbianStdioStream *makeFromPath(const Common::String &path, bool writeMode);
+
+	SymbianStdioStream(void *handle);
+	virtual ~SymbianStdioStream();
+
+	bool ioFailed() const;
+	void clearIOFailed();
+	bool eos() const;
+
+	virtual uint32 write(const void *dataPtr, uint32 dataSize);
+	virtual void flush();
+
+	virtual uint32 pos() const;
+	virtual uint32 size() const;
+	void seek(int32 offs, int whence = SEEK_SET);
+	uint32 read(void *dataPtr, uint32 dataSize);
+};
+
+#endif


Property changes on: scummvm/trunk/backends/fs/symbian/symbianstream.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native


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