From 655ce26b3f09628d9408a4d82efe3a26116999fe Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 13 Sep 2008 16:51:46 +0000 Subject: Big patch changing the signature of various Stream methods (some ports may need to be slightly tweaked to fix overloading errors/warnings) svn-id: r34514 --- common/file.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'common/file.cpp') diff --git a/common/file.cpp b/common/file.cpp index ba94cb285a..1297775f15 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -113,13 +113,7 @@ bool File::open(const FilesystemNode &node) { } else if (node.isDirectory()) { warning("File::open: Trying to open a FilesystemNode which is a directory"); return false; - } /*else if (!node.isReadable() && mode == kFileReadMode) { - warning("File::open: Trying to open an unreadable FilesystemNode object for reading"); - return false; - } else if (!node.isWritable() && mode == kFileWriteMode) { - warning("File::open: Trying to open an unwritable FilesystemNode object for writing"); - return false; - }*/ + } String filename(node.getName()); @@ -181,19 +175,19 @@ bool File::eos() const { return _handle->eos(); } -uint32 File::pos() const { +int32 File::pos() const { assert(_handle); return _handle->pos(); } -uint32 File::size() const { +int32 File::size() const { assert(_handle); return _handle->size(); } -void File::seek(int32 offs, int whence) { +bool File::seek(int32 offs, int whence) { assert(_handle); - _handle->seek(offs, whence); + return _handle->seek(offs, whence); } uint32 File::read(void *ptr, uint32 len) { @@ -223,13 +217,7 @@ bool DumpFile::open(const FilesystemNode &node) { if (node.isDirectory()) { warning("File::open: Trying to open a FilesystemNode which is a directory"); return false; - } /*else if (!node.isReadable() && mode == kFileReadMode) { - warning("File::open: Trying to open an unreadable FilesystemNode object for reading"); - return false; - } else if (!node.isWritable() && mode == kFileWriteMode) { - warning("File::open: Trying to open an unwritable FilesystemNode object for writing"); - return false; - }*/ + } _handle = node.openForWriting(); @@ -263,9 +251,9 @@ uint32 DumpFile::write(const void *ptr, uint32 len) { return _handle->write(ptr, len); } -void DumpFile::flush() { +bool DumpFile::flush() { assert(_handle); - _handle->flush(); + return _handle->flush(); } } // End of namespace Common -- cgit v1.2.3