aboutsummaryrefslogtreecommitdiff
path: root/common/file.cpp
diff options
context:
space:
mode:
authorMax Horn2008-09-13 16:51:46 +0000
committerMax Horn2008-09-13 16:51:46 +0000
commit655ce26b3f09628d9408a4d82efe3a26116999fe (patch)
tree779a25dbe25c8f916fb385b3dd2d48e0e379d9ec /common/file.cpp
parentb86a047164b54c20366fcbe21b55bf63f2ced5f4 (diff)
downloadscummvm-rg350-655ce26b3f09628d9408a4d82efe3a26116999fe.tar.gz
scummvm-rg350-655ce26b3f09628d9408a4d82efe3a26116999fe.tar.bz2
scummvm-rg350-655ce26b3f09628d9408a4d82efe3a26116999fe.zip
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
Diffstat (limited to 'common/file.cpp')
-rw-r--r--common/file.cpp28
1 files changed, 8 insertions, 20 deletions
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