mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-03 15:21:40 +00:00
Add gets() method to File class.
svn-id: r15572
This commit is contained in:
parent
6299eaa546
commit
54dc902ae4
@ -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;
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
virtual void seek(int32 offs, int whence = SEEK_SET);
|
||||
uint32 read(void *ptr, uint32 size);
|
||||
uint32 write(const void *ptr, uint32 size);
|
||||
char *gets(void *ptr, uint32 size);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user