mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 14:51:40 +00:00
Implemented DumpFile::open(FSNode)
svn-id: r33586
This commit is contained in:
parent
b54a1227d9
commit
fe9323ae57
@ -494,6 +494,31 @@ bool DumpFile::open(const String &filename) {
|
||||
return _handle != NULL;
|
||||
}
|
||||
|
||||
bool DumpFile::open(const FilesystemNode &node) {
|
||||
assert(!_handle);
|
||||
|
||||
if (!node.exists()) {
|
||||
warning("File::open: Trying to open a FilesystemNode which does not exist");
|
||||
return false;
|
||||
} 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;
|
||||
}*/
|
||||
|
||||
_handle = fopen(node.getPath().c_str(), "rb");
|
||||
|
||||
if (_handle == NULL)
|
||||
debug(2, "File %s not found", node.getName().c_str());
|
||||
|
||||
return _handle != NULL;
|
||||
}
|
||||
|
||||
void DumpFile::close() {
|
||||
if (_handle)
|
||||
fclose((FILE *)_handle);
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
virtual ~DumpFile();
|
||||
|
||||
virtual bool open(const String &filename);
|
||||
//virtual bool open(const FilesystemNode &node);
|
||||
virtual bool open(const FilesystemNode &node);
|
||||
|
||||
virtual void close();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user