aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/archive.cpp2
-rw-r--r--common/file.cpp4
-rw-r--r--common/fs.cpp14
-rw-r--r--common/fs.h10
-rw-r--r--common/md5.cpp2
-rw-r--r--common/system.cpp4
-rw-r--r--common/unzip.cpp2
-rw-r--r--common/xmlparser.cpp2
8 files changed, 20 insertions, 20 deletions
diff --git a/common/archive.cpp b/common/archive.cpp
index d9d0a0a1d8..1a78f4629a 100644
--- a/common/archive.cpp
+++ b/common/archive.cpp
@@ -150,7 +150,7 @@ SeekableReadStream *FSDirectory::openFile(const String &name) {
return 0;
}
- SeekableReadStream *stream = node.openForReading();
+ SeekableReadStream *stream = node.createReadStream();
if (!stream)
warning("FSDirectory::openFile: Can't create stream for file '%s'", name.c_str());
diff --git a/common/file.cpp b/common/file.cpp
index 51736ccd67..6184004b35 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -84,7 +84,7 @@ bool File::open(const FSNode &node) {
return false;
}
- SeekableReadStream *stream = node.openForReading();
+ SeekableReadStream *stream = node.createReadStream();
return open(stream, node.getPath());
}
@@ -192,7 +192,7 @@ bool DumpFile::open(const FSNode &node) {
return false;
}
- _handle = node.openForWriting();
+ _handle = node.createWriteStream();
if (_handle == NULL)
debug(2, "File %s not found", node.getName().c_str());
diff --git a/common/fs.cpp b/common/fs.cpp
index de553d42b7..f911b544b0 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -135,31 +135,31 @@ bool FSNode::isWritable() const {
return _realNode->isWritable();
}
-Common::SeekableReadStream *FSNode::openForReading() const {
+Common::SeekableReadStream *FSNode::createReadStream() const {
if (_realNode == 0)
return 0;
if (!_realNode->exists()) {
- warning("FSNode::openForReading: FSNode does not exist");
+ warning("FSNode::createReadStream: FSNode does not exist");
return false;
} else if (_realNode->isDirectory()) {
- warning("FSNode::openForReading: FSNode is a directory");
+ warning("FSNode::createReadStream: FSNode is a directory");
return false;
}
- return _realNode->openForReading();
+ return _realNode->createReadStream();
}
-Common::WriteStream *FSNode::openForWriting() const {
+Common::WriteStream *FSNode::createWriteStream() const {
if (_realNode == 0)
return 0;
if (_realNode->isDirectory()) {
- warning("FSNode::openForWriting: FSNode is a directory");
+ warning("FSNode::createWriteStream: FSNode is a directory");
return 0;
}
- return _realNode->openForWriting();
+ return _realNode->createWriteStream();
}
} // End of namespace Common
diff --git a/common/fs.h b/common/fs.h
index d530cbae4f..72b492e9c4 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -109,9 +109,9 @@ public:
* If a child matching the name exists, a normal node for it is returned.
* If no child with the name exists, a node for it is still returned,
* but exists() will return 'false' for it. This node can however be used
- * to create a new file using the openForWriting() method.
+ * to create a new file using the createWriteStream() method.
*
- * @todo If openForWriting() (or a hypothetical future mkdir() method) is used,
+ * @todo If createWriteStream() (or a hypothetical future mkdir() method) is used,
* this should affect what exists/isDirectory/isReadable/isWritable return
* for existing nodes. However, this is not the case for many existing
* FSNode implementations. Either fix those, or document that FSNodes
@@ -213,7 +213,7 @@ public:
*
* @return pointer to the stream object, 0 in case of a failure
*/
- virtual SeekableReadStream *openForReading() const;
+ virtual SeekableReadStream *createReadStream() const;
/**
* Creates a WriteStream instance corresponding to the file
@@ -222,11 +222,11 @@ public:
*
* @return pointer to the stream object, 0 in case of a failure
*/
- virtual WriteStream *openForWriting() const;
+ virtual WriteStream *createWriteStream() const;
// Compatibility with ArchiveMember API.
SeekableReadStream *open() {
- return openForReading();
+ return createReadStream();
}
};
diff --git a/common/md5.cpp b/common/md5.cpp
index daaf176b7c..a1b60816c6 100644
--- a/common/md5.cpp
+++ b/common/md5.cpp
@@ -258,7 +258,7 @@ bool md5_file(const FSNode &file, uint8 digest[16], uint32 length) {
return false;
}
- ReadStream *stream = file.openForReading();
+ ReadStream *stream = file.createReadStream();
if (!stream) {
warning("md5_file: failed to open '%s'", file.getPath().c_str());
return false;
diff --git a/common/system.cpp b/common/system.cpp
index dbbfef54b2..1c89c4048d 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -116,7 +116,7 @@ void OSystem::clearScreen() {
Common::SeekableReadStream *OSystem::createConfigReadStream() {
Common::FSNode file(DEFAULT_CONFIG_FILE);
- return file.openForReading();
+ return file.createReadStream();
}
Common::WriteStream *OSystem::createConfigWriteStream() {
@@ -124,6 +124,6 @@ Common::WriteStream *OSystem::createConfigWriteStream() {
return 0;
#else
Common::FSNode file(DEFAULT_CONFIG_FILE);
- return file.openForWriting();
+ return file.createWriteStream();
#endif
}
diff --git a/common/unzip.cpp b/common/unzip.cpp
index abb2096f4a..25e26ec24c 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -1381,7 +1381,7 @@ ZipArchive::ZipArchive(const Common::String &name) {
}
ZipArchive::ZipArchive(const Common::FSNode &node) {
- SeekableReadStream *stream = node.openForReading();
+ SeekableReadStream *stream = node.createReadStream();
_zipFile = unzOpen(stream);
}
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp
index 91cd6aa458..10085d3b8e 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -40,7 +40,7 @@ bool XMLParser::loadFile(const Common::String &filename) {
}
bool XMLParser::loadFile(const FSNode &node) {
- _stream = node.openForReading();
+ _stream = node.createReadStream();
if (!_stream)
return false;