aboutsummaryrefslogtreecommitdiff
path: root/common/file.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2004-10-16 13:09:52 +0000
committerEugene Sandulenko2004-10-16 13:09:52 +0000
commit54dc902ae4b12a140e450673fb51a42b8ca39b4d (patch)
tree62795f7ea2d7fdfabdb60f457272ea7dd6f27cd5 /common/file.cpp
parent6299eaa546b085ebc3e1c21fd6863511507e2984 (diff)
downloadscummvm-rg350-54dc902ae4b12a140e450673fb51a42b8ca39b4d.tar.gz
scummvm-rg350-54dc902ae4b12a140e450673fb51a42b8ca39b4d.tar.bz2
scummvm-rg350-54dc902ae4b12a140e450673fb51a42b8ca39b4d.zip
Add gets() method to File class.
svn-id: r15572
Diffstat (limited to 'common/file.cpp')
-rw-r--r--common/file.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/file.cpp b/common/file.cpp
index 6b7b954942..d2abdf75cc 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -269,3 +269,20 @@ uint32 File::write(const void *ptr, uint32 len) {
return len;
}
+
+char *File::gets(void *ptr, uint32 len) {
+ char *ptr2 = (char *)ptr;
+ char *res;
+
+ if (_handle == NULL) {
+ error("File::gets: File is not open!");
+ return 0;
+ }
+
+ if (len == 0)
+ return 0;
+
+ res = fgets(ptr2, len, _handle);
+
+ return res;
+}