mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 20:34:12 +00:00
BACKENDS: Rename and simplify AbstractFSNode::create()
This commit is contained in:
parent
8666e9564f
commit
66ef50cfeb
@ -193,13 +193,11 @@ public:
|
|||||||
virtual Common::WriteStream *createWriteStream() = 0;
|
virtual Common::WriteStream *createWriteStream() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a file referred by this node.
|
* Creates a directory referred by this node.
|
||||||
*
|
*
|
||||||
* @param isDirectoryFlag true if created file must be a directory
|
* @return true if the directory is created successfully
|
||||||
*
|
|
||||||
* @return true if file is created successfully
|
|
||||||
*/
|
*/
|
||||||
virtual bool create(bool isDirectoryFlag) = 0;
|
virtual bool createDirectory() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ Common::WriteStream *AmigaOSFilesystemNode::createWriteStream() {
|
|||||||
return StdioStream::makeFromPath(getPath(), true);
|
return StdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AmigaOSFilesystemNode::create(bool isDirectoryFlag) {
|
bool AmigaOSFilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ Common::WriteStream *ChRootFilesystemNode::createWriteStream() {
|
|||||||
return _realNode->createWriteStream();
|
return _realNode->createWriteStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChRootFilesystemNode::create(bool isDirectoryFlag) {
|
bool ChRootFilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Common::String addPathComponent(const Common::String &path, const Common::String &component);
|
static Common::String addPathComponent(const Common::String &path, const Common::String &component);
|
||||||
|
@ -211,7 +211,7 @@ Common::WriteStream *DSFileSystemNode::createWriteStream() {
|
|||||||
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
|
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DSFileSystemNode::create(bool isDirectoryFlag) {
|
bool DSFileSystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -398,7 +398,7 @@ Common::WriteStream *GBAMPFileSystemNode::createWriteStream() {
|
|||||||
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
|
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GBAMPFileSystemNode::create(bool isDirectoryFlag) {
|
bool GBAMPFileSystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the zip file this node points to.
|
* Returns the zip file this node points to.
|
||||||
@ -157,7 +157,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fileHandle {
|
struct fileHandle {
|
||||||
|
@ -160,7 +160,7 @@ Common::WriteStream *N64FilesystemNode::createWriteStream() {
|
|||||||
return RomfsStream::makeFromPath(getPath(), true);
|
return RomfsStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool N64FilesystemNode::create(bool isDirectoryFlag) {
|
bool N64FilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -299,33 +299,11 @@ Common::WriteStream *POSIXFilesystemNode::createWriteStream() {
|
|||||||
return StdioStream::makeFromPath(getPath(), true);
|
return StdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool POSIXFilesystemNode::create(bool isDirectoryFlag) {
|
bool POSIXFilesystemNode::createDirectory() {
|
||||||
bool success;
|
if (mkdir(_path.c_str(), 0755) == 0)
|
||||||
|
|
||||||
if (isDirectoryFlag) {
|
|
||||||
success = mkdir(_path.c_str(), 0755) == 0;
|
|
||||||
} else {
|
|
||||||
int fd = open(_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0755);
|
|
||||||
success = fd >= 0;
|
|
||||||
|
|
||||||
if (fd >= 0) {
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
setFlags();
|
setFlags();
|
||||||
if (_isValid) {
|
|
||||||
if (_isDirectory != isDirectoryFlag) warning("failed to create %s: got %s", isDirectoryFlag ? "directory" : "file", _isDirectory ? "directory" : "file");
|
|
||||||
return _isDirectory == isDirectoryFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
warning("POSIXFilesystemNode: %s() was a success, but stat indicates there is no such %s",
|
return _isValid && _isDirectory;
|
||||||
isDirectoryFlag ? "mkdir" : "creat", isDirectoryFlag ? "directory" : "file");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Posix {
|
namespace Posix {
|
||||||
|
@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
@ -443,7 +443,7 @@ Common::WriteStream *Ps2FilesystemNode::createWriteStream() {
|
|||||||
return PS2FileStream::makeFromPath(getPath(), true);
|
return PS2FileStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Ps2FilesystemNode::create(bool isDirectoryFlag) {
|
bool Ps2FilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
|
|
||||||
int getDev() { return 0; }
|
int getDev() { return 0; }
|
||||||
};
|
};
|
||||||
|
@ -239,7 +239,7 @@ Common::WriteStream *PSPFilesystemNode::createWriteStream() {
|
|||||||
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
|
return Common::wrapBufferedWriteStream(stream, WRITE_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PSPFilesystemNode::create(bool isDirectoryFlag) {
|
bool PSPFilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -52,12 +52,7 @@ bool RISCOSFilesystemNode::isWritable() const {
|
|||||||
return access(_path.c_str(), W_OK) == 0;
|
return access(_path.c_str(), W_OK) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
RISCOSFilesystemNode::RISCOSFilesystemNode(const Common::String &p) {
|
void RISCOSFilesystemNode::setFlags() {
|
||||||
_path = p;
|
|
||||||
if (p == "/") {
|
|
||||||
_isDirectory = true;
|
|
||||||
_isValid = true;
|
|
||||||
} else {
|
|
||||||
int type = _swi(OS_File, _INR(0,1)|_RETURN(0), 20, RISCOS_Utils::toRISCOS(_path).c_str());
|
int type = _swi(OS_File, _INR(0,1)|_RETURN(0), 20, RISCOS_Utils::toRISCOS(_path).c_str());
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
_isDirectory = false;
|
_isDirectory = false;
|
||||||
@ -70,6 +65,15 @@ RISCOSFilesystemNode::RISCOSFilesystemNode(const Common::String &p) {
|
|||||||
_isValid = true;
|
_isValid = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RISCOSFilesystemNode::RISCOSFilesystemNode(const Common::String &p) {
|
||||||
|
_path = p;
|
||||||
|
if (p == "/") {
|
||||||
|
_isDirectory = true;
|
||||||
|
_isValid = true;
|
||||||
|
} else {
|
||||||
|
setFlags();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractFSNode *RISCOSFilesystemNode::getChild(const Common::String &n) const {
|
AbstractFSNode *RISCOSFilesystemNode::getChild(const Common::String &n) const {
|
||||||
@ -198,33 +202,11 @@ Common::WriteStream *RISCOSFilesystemNode::createWriteStream() {
|
|||||||
return StdioStream::makeFromPath(getPath(), true);
|
return StdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RISCOSFilesystemNode::create(bool isDirectoryFlag) {
|
bool RISCOSFilesystemNode::createDirectory() {
|
||||||
bool success;
|
if (_swix(OS_File, _INR(0,1), 8, RISCOS_Utils::toRISCOS(_path).c_str()) == NULL)
|
||||||
|
setFlags();
|
||||||
|
|
||||||
if (isDirectoryFlag) {
|
return _isValid && _isDirectory;
|
||||||
success = _swix(OS_File, _INR(0,1), 8, RISCOS_Utils::toRISCOS(_path).c_str()) == NULL;
|
|
||||||
} else {
|
|
||||||
int fd = open(_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0755);
|
|
||||||
success = fd >= 0;
|
|
||||||
|
|
||||||
if (fd >= 0) {
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
if (exists()) {
|
|
||||||
_isDirectory = _swi(OS_File, _INR(0,1)|_RETURN(0), 20, RISCOS_Utils::toRISCOS(_path).c_str()) == 2;
|
|
||||||
if (_isDirectory != isDirectoryFlag) warning("failed to create %s: got %s", isDirectoryFlag ? "directory" : "file", _isDirectory ? "directory" : "file");
|
|
||||||
return _isDirectory == isDirectoryFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
warning("RISCOSFilesystemNode: Attempting to create a %s was a success, but access indicates there is no such %s",
|
|
||||||
isDirectoryFlag ? "directory" : "file", isDirectoryFlag ? "directory" : "file");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Riscos {
|
namespace Riscos {
|
||||||
@ -270,7 +252,7 @@ bool assureDirectoryExists(const Common::String &dir, const char *prefix) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
node = new RISCOSFilesystemNode(path);
|
node = new RISCOSFilesystemNode(path);
|
||||||
if (!node->create(true)) {
|
if (!node->createDirectory()) {
|
||||||
if (node->exists()) {
|
if (node->exists()) {
|
||||||
if (!node->isDirectory()) {
|
if (!node->isDirectory()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -67,7 +67,12 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* Tests and sets the _isValid and _isDirectory flags, using OS_File 20.
|
||||||
|
*/
|
||||||
|
virtual void setFlags();
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Riscos {
|
namespace Riscos {
|
||||||
|
@ -232,7 +232,7 @@ Common::WriteStream *SymbianFilesystemNode::createWriteStream() {
|
|||||||
return SymbianStdioStream::makeFromPath(getPath(), true);
|
return SymbianStdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SymbianFilesystemNode::create(bool isDirectoryFlag) {
|
bool SymbianFilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -213,7 +213,7 @@ Common::WriteStream *WiiFilesystemNode::createWriteStream() {
|
|||||||
return StdioStream::makeFromPath(getPath(), true);
|
return StdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiiFilesystemNode::create(bool isDirectoryFlag) {
|
bool WiiFilesystemNode::createDirectory() {
|
||||||
error("Not supported");
|
error("Not supported");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -134,6 +134,12 @@ WindowsFilesystemNode::WindowsFilesystemNode(const Common::String &p, const bool
|
|||||||
|
|
||||||
_displayName = lastPathComponent(_path, '\\');
|
_displayName = lastPathComponent(_path, '\\');
|
||||||
|
|
||||||
|
setFlags();
|
||||||
|
|
||||||
|
_isPseudoRoot = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowsFilesystemNode::setFlags() {
|
||||||
// Check whether it is a directory, and whether the file actually exists
|
// Check whether it is a directory, and whether the file actually exists
|
||||||
DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str()));
|
DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str()));
|
||||||
|
|
||||||
@ -148,7 +154,6 @@ WindowsFilesystemNode::WindowsFilesystemNode(const Common::String &p, const bool
|
|||||||
_path += '\\';
|
_path += '\\';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_isPseudoRoot = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractFSNode *WindowsFilesystemNode::getChild(const Common::String &n) const {
|
AbstractFSNode *WindowsFilesystemNode::getChild(const Common::String &n) const {
|
||||||
@ -244,36 +249,11 @@ Common::WriteStream *WindowsFilesystemNode::createWriteStream() {
|
|||||||
return StdioStream::makeFromPath(getPath(), true);
|
return StdioStream::makeFromPath(getPath(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowsFilesystemNode::create(bool isDirectoryFlag) {
|
bool WindowsFilesystemNode::createDirectory() {
|
||||||
bool success;
|
if (CreateDirectory(toUnicode(_path.c_str()), NULL) != 0)
|
||||||
|
setFlags();
|
||||||
|
|
||||||
if (isDirectoryFlag) {
|
return _isValid && _isDirectory;
|
||||||
success = CreateDirectory(toUnicode(_path.c_str()), NULL) != 0;
|
|
||||||
} else {
|
|
||||||
success = CreateFile(toUnicode(_path.c_str()), GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL) != INVALID_HANDLE_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
//this piece is copied from constructor, it checks that file exists and detects whether it's a directory
|
|
||||||
DWORD fileAttribs = GetFileAttributes(toUnicode(_path.c_str()));
|
|
||||||
if (fileAttribs != INVALID_FILE_ATTRIBUTES) {
|
|
||||||
_isDirectory = ((fileAttribs & FILE_ATTRIBUTE_DIRECTORY) != 0);
|
|
||||||
_isValid = true;
|
|
||||||
// Add a trailing slash, if necessary.
|
|
||||||
if (_isDirectory && _path.lastChar() != '\\') {
|
|
||||||
_path += '\\';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_isDirectory != isDirectoryFlag) warning("failed to create %s: got %s", isDirectoryFlag ? "directory" : "file", _isDirectory ? "directory" : "file");
|
|
||||||
return _isDirectory == isDirectoryFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
warning("WindowsFilesystemNode: Create%s() was a success, but GetFileAttributes() indicates there is no such %s",
|
|
||||||
isDirectoryFlag ? "Directory" : "File", isDirectoryFlag ? "directory" : "file");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //#ifdef WIN32
|
#endif //#ifdef WIN32
|
||||||
|
@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream();
|
virtual Common::WriteStream *createWriteStream();
|
||||||
virtual bool create(bool isDirectoryFlag);
|
virtual bool createDirectory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
@ -114,6 +114,11 @@ private:
|
|||||||
* @return str in Unicode format.
|
* @return str in Unicode format.
|
||||||
*/
|
*/
|
||||||
static const TCHAR* toUnicode(const char *str);
|
static const TCHAR* toUnicode(const char *str);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests and sets the _isValid and _isDirectory flags, using the GetFileAttributes() function.
|
||||||
|
*/
|
||||||
|
virtual void setFlags();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -100,7 +100,7 @@ void CreateDirectoryHandler::handle(Client &client) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// create the <directory_name> in <path>
|
// create the <directory_name> in <path>
|
||||||
if (!node->create(true)) {
|
if (!node->createDirectory()) {
|
||||||
handleError(client, _("Failed to create the directory!"));
|
handleError(client, _("Failed to create the directory!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
|
|
||||||
virtual Common::SeekableReadStream *createReadStream();
|
virtual Common::SeekableReadStream *createReadStream();
|
||||||
virtual Common::WriteStream *createWriteStream() { return 0; }
|
virtual Common::WriteStream *createWriteStream() { return 0; }
|
||||||
virtual bool create(bool isDirectoryFlag) { return false; }
|
virtual bool createDirectory() { return false; }
|
||||||
|
|
||||||
static AbstractFSNode *makeFileNodePath(const Common::String &path);
|
static AbstractFSNode *makeFileNodePath(const Common::String &path);
|
||||||
};
|
};
|
||||||
|
@ -166,7 +166,7 @@ bool DumpFile::open(const String &filename, bool createPath) {
|
|||||||
delete node;
|
delete node;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!node->create(true)) warning("DumpFile: unable to create directories from path prefix");
|
if (!node->createDirectory()) warning("DumpFile: unable to create directories from path prefix");
|
||||||
delete node;
|
delete node;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user