[Scummvm-cvs-logs] SF.net SVN: scummvm:[36021] scummvm/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Jan 23 05:45:44 CET 2009
Revision: 36021
http://scummvm.svn.sourceforge.net/scummvm/?rev=36021&view=rev
Author: fingolfin
Date: 2009-01-23 04:45:44 +0000 (Fri, 23 Jan 2009)
Log Message:
-----------
Renamed Archive::openFile to createReadStreamForMember
Modified Paths:
--------------
scummvm/trunk/backends/vkeybd/virtual-keyboard-parser.cpp
scummvm/trunk/backends/vkeybd/virtual-keyboard.cpp
scummvm/trunk/common/archive.cpp
scummvm/trunk/common/archive.h
scummvm/trunk/common/file.cpp
scummvm/trunk/common/fs.h
scummvm/trunk/common/unarj.cpp
scummvm/trunk/common/unzip.cpp
scummvm/trunk/common/unzip.h
scummvm/trunk/common/xmlparser.cpp
scummvm/trunk/engines/kyra/resource.cpp
scummvm/trunk/engines/kyra/resource_intern.cpp
scummvm/trunk/engines/kyra/resource_intern.h
scummvm/trunk/engines/parallaction/disk_br.cpp
scummvm/trunk/engines/parallaction/disk_ns.cpp
scummvm/trunk/engines/scumm/he/resource_he.cpp
scummvm/trunk/engines/scumm/he/script_v60he.cpp
scummvm/trunk/graphics/video/dxa_player.cpp
scummvm/trunk/graphics/video/flic_player.cpp
scummvm/trunk/graphics/video/smk_player.cpp
scummvm/trunk/gui/ThemeEngine.cpp
Modified: scummvm/trunk/backends/vkeybd/virtual-keyboard-parser.cpp
===================================================================
--- scummvm/trunk/backends/vkeybd/virtual-keyboard-parser.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/backends/vkeybd/virtual-keyboard-parser.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -252,7 +252,7 @@
_mode->bitmapName = node->values["bitmap"];
- SeekableReadStream *file = _keyboard->_fileArchive->openFile(_mode->bitmapName);
+ SeekableReadStream *file = _keyboard->_fileArchive->createReadStreamForMember(_mode->bitmapName);
if (!file)
return parserError("Bitmap '%s' not found", _mode->bitmapName.c_str());
Modified: scummvm/trunk/backends/vkeybd/virtual-keyboard.cpp
===================================================================
--- scummvm/trunk/backends/vkeybd/virtual-keyboard.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/backends/vkeybd/virtual-keyboard.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -103,7 +103,7 @@
#ifdef USE_ZLIB
_fileArchive = new ZipArchive(vkDir.getChild(packName + ".zip"));
if (_fileArchive->hasFile(packName + ".xml")) {
- if (!_parser->loadStream(_fileArchive->openFile(packName + ".xml")))
+ if (!_parser->loadStream(_fileArchive->createReadStreamForMember(packName + ".xml")))
return false;
} else {
warning("Could not find %s.xml file in %s.zip keyboard pack", packName.c_str(), packName.c_str());
Modified: scummvm/trunk/common/archive.cpp
===================================================================
--- scummvm/trunk/common/archive.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/archive.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -39,7 +39,7 @@
}
SeekableReadStream *GenericArchiveMember::createReadStream() const {
- return _parent->openFile(_name);
+ return _parent->createReadStreamForMember(_name);
}
@@ -136,23 +136,23 @@
return ArchiveMemberPtr(new FSNode(node));
}
-SeekableReadStream *FSDirectory::openFile(const String &name) const {
+SeekableReadStream *FSDirectory::createReadStreamForMember(const String &name) const {
if (name.empty() || !_node.isDirectory())
return 0;
FSNode node = lookupCache(_fileCache, name);
if (!node.exists()) {
- warning("FSDirectory::openFile: FSNode does not exist");
+ warning("FSDirectory::createReadStreamForMember: FSNode does not exist");
return 0;
} else if (node.isDirectory()) {
- warning("FSDirectory::openFile: FSNode is a directory");
+ warning("FSDirectory::createReadStreamForMember: FSNode is a directory");
return 0;
}
SeekableReadStream *stream = node.createReadStream();
if (!stream)
- warning("FSDirectory::openFile: Can't create stream for file '%s'", name.c_str());
+ warning("FSDirectory::createReadStreamForMember: Can't create stream for file '%s'", name.c_str());
return stream;
}
@@ -434,14 +434,14 @@
return ArchiveMemberPtr();
}
-SeekableReadStream *SearchSet::openFile(const String &name) const {
+SeekableReadStream *SearchSet::createReadStreamForMember(const String &name) const {
if (name.empty())
return 0;
ArchiveNodeList::iterator it = _list.begin();
for ( ; it != _list.end(); ++it) {
if (it->_arc->hasFile(name))
- return it->_arc->openFile(name);
+ return it->_arc->createReadStreamForMember(name);
}
return 0;
Modified: scummvm/trunk/common/archive.h
===================================================================
--- scummvm/trunk/common/archive.h 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/archive.h 2009-01-23 04:45:44 UTC (rev 36021)
@@ -95,7 +95,7 @@
/**
* Add all the names present in the Archive which match pattern to
- * list. Returned names can be used as parameters to openFile.
+ * list. Returned names can be used as parameters to createReadStreamForMember.
* Must not remove elements from the list.
*
* @return the number of names added to list
@@ -104,7 +104,7 @@
/**
* Add all the names present in the Archive to list. Returned
- * names can be used as parameters to openFile.
+ * names can be used as parameters to createReadStreamForMember.
* Must not remove elements from the list.
*
* @return the number of names added to list
@@ -120,7 +120,7 @@
* Create a stream bound to a file in the archive.
* @return the newly created input stream
*/
- virtual SeekableReadStream *openFile(const String &name) const = 0;
+ virtual SeekableReadStream *createReadStreamForMember(const String &name) const = 0;
};
@@ -194,10 +194,10 @@
virtual ArchiveMemberPtr getMember(const String &name);
/**
- * Implements openFile from Archive base class. The current policy is
+ * Implements createReadStreamForMember from Archive base class. The current policy is
* opening the first file encountered that matches the name.
*/
- virtual SeekableReadStream *openFile(const String &name) const;
+ virtual SeekableReadStream *createReadStreamForMember(const String &name) const;
};
Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/file.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -62,12 +62,12 @@
SeekableReadStream *stream = 0;
if (archive.hasFile(filename)) {
debug(3, "Opening hashed: %s", filename.c_str());
- stream = archive.openFile(filename);
+ stream = archive.createReadStreamForMember(filename);
} else if (archive.hasFile(filename + ".")) {
// WORKAROUND: Bug #1458388: "SIMON1: Game Detection fails"
// sometimes instead of "GAMEPC" we get "GAMEPC." (note trailing dot)
debug(3, "Opening hashed: %s.", filename.c_str());
- stream = archive.openFile(filename + ".");
+ stream = archive.createReadStreamForMember(filename + ".");
}
return open(stream, filename);
Modified: scummvm/trunk/common/fs.h
===================================================================
--- scummvm/trunk/common/fs.h 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/fs.h 2009-01-23 04:45:44 UTC (rev 36021)
@@ -243,7 +243,7 @@
* Again, only SLASHES are used as separators independently from the
* underlying file system.
*
- * Relative paths can be specified when calling matching functions like openFile(),
+ * Relative paths can be specified when calling matching functions like createReadStreamForMember(),
* hasFile(), listMatchingMembers() and listMembers(). Please see the function
* specific comments for more information.
*
@@ -333,7 +333,7 @@
* Open the specified file. A full match of relative path and filename is needed
* for success.
*/
- virtual SeekableReadStream *openFile(const String &name) const;
+ virtual SeekableReadStream *createReadStreamForMember(const String &name) const;
};
Modified: scummvm/trunk/common/unarj.cpp
===================================================================
--- scummvm/trunk/common/unarj.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/unarj.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -350,7 +350,7 @@
error("Attempt to open another instance of archive");
if (_fallBack) {
- _uncompressed = SearchMan.openFile(filename);
+ _uncompressed = SearchMan.createReadStreamForMember(filename);
if (_uncompressed)
return true;
}
Modified: scummvm/trunk/common/unzip.cpp
===================================================================
--- scummvm/trunk/common/unzip.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/unzip.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -1376,7 +1376,7 @@
*/
ZipArchive::ZipArchive(const Common::String &name) {
- SeekableReadStream *stream = SearchMan.openFile(name);
+ SeekableReadStream *stream = SearchMan.createReadStreamForMember(name);
_zipFile = unzOpen(stream);
}
@@ -1428,7 +1428,7 @@
return ArchiveMemberPtr(new GenericArchiveMember(name, this));
}
-Common::SeekableReadStream *ZipArchive::openFile(const Common::String &name) const {
+Common::SeekableReadStream *ZipArchive::createReadStreamForMember(const Common::String &name) const {
if (!_zipFile)
return 0;
Modified: scummvm/trunk/common/unzip.h
===================================================================
--- scummvm/trunk/common/unzip.h 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/unzip.h 2009-01-23 04:45:44 UTC (rev 36021)
@@ -62,7 +62,7 @@
virtual bool hasFile(const String &name);
virtual int listMembers(ArchiveMemberList &list);
virtual ArchiveMemberPtr getMember(const String &name);
- virtual SeekableReadStream *openFile(const String &name) const;
+ virtual SeekableReadStream *createReadStreamForMember(const String &name) const;
};
} // End of namespace Common
Modified: scummvm/trunk/common/xmlparser.cpp
===================================================================
--- scummvm/trunk/common/xmlparser.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/common/xmlparser.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -31,7 +31,7 @@
namespace Common {
bool XMLParser::loadFile(const Common::String &filename) {
- _stream = SearchMan.openFile(filename);
+ _stream = SearchMan.createReadStreamForMember(filename);
if (!_stream)
return false;
Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/kyra/resource.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -311,7 +311,7 @@
}
Common::SeekableReadStream *Resource::getFileStream(const Common::String &file) {
- return _files.openFile(file);
+ return _files.createReadStreamForMember(file);
}
Common::Archive *Resource::loadArchive(const Common::String &name, Common::SharedPtr<Common::ArchiveMember> member) {
Modified: scummvm/trunk/engines/kyra/resource_intern.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource_intern.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/kyra/resource_intern.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -69,7 +69,7 @@
return Common::ArchiveMemberPtr(new Common::GenericArchiveMember(name, this));
}
-Common::SeekableReadStream *PlainArchive::openFile(const Common::String &name) const {
+Common::SeekableReadStream *PlainArchive::createReadStreamForMember(const Common::String &name) const {
FileMap::const_iterator fDesc = _files.find(name);
if (fDesc == _files.end())
return 0;
@@ -124,7 +124,7 @@
return Common::ArchiveMemberPtr(new Common::GenericArchiveMember(name, this));
}
-Common::SeekableReadStream *CachedArchive::openFile(const Common::String &name) const {
+Common::SeekableReadStream *CachedArchive::createReadStreamForMember(const Common::String &name) const {
FileMap::const_iterator fDesc = _files.find(name);
if (fDesc == _files.end())
return 0;
Modified: scummvm/trunk/engines/kyra/resource_intern.h
===================================================================
--- scummvm/trunk/engines/kyra/resource_intern.h 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/kyra/resource_intern.h 2009-01-23 04:45:44 UTC (rev 36021)
@@ -52,7 +52,7 @@
bool hasFile(const Common::String &name);
int listMembers(Common::ArchiveMemberList &list);
Common::ArchiveMemberPtr getMember(const Common::String &name);
- Common::SeekableReadStream *openFile(const Common::String &name) const;
+ Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
private:
struct Entry {
uint32 offset;
@@ -82,7 +82,7 @@
bool hasFile(const Common::String &name);
int listMembers(Common::ArchiveMemberList &list);
Common::ArchiveMemberPtr getMember(const Common::String &name);
- Common::SeekableReadStream *openFile(const Common::String &name) const;
+ Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
private:
struct Entry {
byte *data;
Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -101,7 +101,7 @@
lookup = name + ext;
}
- Common::SeekableReadStream *stream = _sset.openFile(lookup);
+ Common::SeekableReadStream *stream = _sset.createReadStreamForMember(lookup);
if (stream) {
return stream;
}
@@ -116,7 +116,7 @@
lookup.deleteLastChar();
}
lookup += ext;
- stream = _sset.openFile(lookup);
+ stream = _sset.createReadStreamForMember(lookup);
}
}
Modified: scummvm/trunk/engines/parallaction/disk_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_ns.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/parallaction/disk_ns.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -78,7 +78,7 @@
NSArchive(Common::SeekableReadStream *stream, Common::Platform platform, uint32 features);
~NSArchive();
- Common::SeekableReadStream *openFile(const Common::String &name) const;
+ Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
bool hasFile(const Common::String &name);
int listMembers(Common::ArchiveMemberList &list);
Common::ArchiveMemberPtr getMember(const Common::String &name);
@@ -127,8 +127,8 @@
return i;
}
-Common::SeekableReadStream *NSArchive::openFile(const Common::String &name) const {
- debugC(3, kDebugDisk, "NSArchive::openFile(%s)", name.c_str());
+Common::SeekableReadStream *NSArchive::createReadStreamForMember(const Common::String &name) const {
+ debugC(3, kDebugDisk, "NSArchive::createReadStreamForMember(%s)", name.c_str());
if (name.empty())
return 0;
@@ -136,7 +136,7 @@
uint32 index = lookup(name.c_str());
if (index == _numFiles) return 0;
- debugC(9, kDebugDisk, "NSArchive::openFile: '%s' found in slot %i", name.c_str(), index);
+ debugC(9, kDebugDisk, "NSArchive::createReadStreamForMember: '%s' found in slot %i", name.c_str(), index);
int offset = _archiveOffsets[index];
int endOffset = _archiveOffsets[index] + _archiveLenghts[index];
@@ -195,7 +195,7 @@
void Disk_ns::addArchive(const Common::String& name, int priority) {
- Common::SeekableReadStream *stream = _sset.openFile(name);
+ Common::SeekableReadStream *stream = _sset.createReadStreamForMember(name);
if (!stream)
error("Disk_ns::addArchive() couldn't find archive '%s'", name.c_str());
@@ -257,13 +257,13 @@
Common::SeekableReadStream *DosDisk_ns::tryOpenFile(const char* name) {
debugC(3, kDebugDisk, "DosDisk_ns::tryOpenFile(%s)", name);
- Common::SeekableReadStream *stream = _sset.openFile(name);
+ Common::SeekableReadStream *stream = _sset.createReadStreamForMember(name);
if (stream)
return stream;
char path[PATH_LEN];
sprintf(path, "%s.pp", name);
- return _sset.openFile(path);
+ return _sset.createReadStreamForMember(path);
}
@@ -896,18 +896,18 @@
Common::SeekableReadStream *AmigaDisk_ns::tryOpenFile(const char* name) {
debugC(3, kDebugDisk, "AmigaDisk_ns::tryOpenFile(%s)", name);
- Common::SeekableReadStream *stream = _sset.openFile(name);
+ Common::SeekableReadStream *stream = _sset.createReadStreamForMember(name);
if (stream)
return stream;
char path[PATH_LEN];
sprintf(path, "%s.pp", name);
- stream = _sset.openFile(path);
+ stream = _sset.createReadStreamForMember(path);
if (stream)
return new PowerPackerStream(*stream);
sprintf(path, "%s.dd", name);
- stream = _sset.openFile(path);
+ stream = _sset.createReadStreamForMember(path);
if (stream)
return new PowerPackerStream(*stream);
Modified: scummvm/trunk/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/resource_he.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/scumm/he/resource_he.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -167,7 +167,7 @@
}
/* get file size */
- fi.file = SearchMan.openFile(_fileName);
+ fi.file = SearchMan.createReadStreamForMember(_fileName);
if (!fi.file) {
error("Cannot open file %s", _fileName.c_str());
}
Modified: scummvm/trunk/engines/scumm/he/script_v60he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v60he.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/engines/scumm/he/script_v60he.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -1010,7 +1010,7 @@
// TODO / FIXME: Consider using listSavefiles to avoid unneccessary openForLoading calls
_hInFileTable[slot] = _saveFileMan->openForLoading(filename);
if (_hInFileTable[slot] == 0) {
- _hInFileTable[slot] = SearchMan.openFile(filename);
+ _hInFileTable[slot] = SearchMan.createReadStreamForMember(filename);
}
break;
case 2:
Modified: scummvm/trunk/graphics/video/dxa_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/dxa_player.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/graphics/video/dxa_player.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -72,7 +72,7 @@
closeFile();
- _fileStream = SearchMan.openFile(fileName);
+ _fileStream = SearchMan.createReadStreamForMember(fileName);
if (!_fileStream)
return false;
Modified: scummvm/trunk/graphics/video/flic_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/flic_player.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/graphics/video/flic_player.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -66,7 +66,7 @@
bool FlicPlayer::loadFile(const char *fileName) {
closeFile();
- _fileStream = SearchMan.openFile(fileName);
+ _fileStream = SearchMan.createReadStreamForMember(fileName);
if (!_fileStream)
return false;
Modified: scummvm/trunk/graphics/video/smk_player.cpp
===================================================================
--- scummvm/trunk/graphics/video/smk_player.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/graphics/video/smk_player.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -356,7 +356,7 @@
closeFile();
- _fileStream = SearchMan.openFile(fileName);
+ _fileStream = SearchMan.createReadStreamForMember(fileName);
if (!_fileStream)
return false;
Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp 2009-01-23 04:36:18 UTC (rev 36020)
+++ scummvm/trunk/gui/ThemeEngine.cpp 2009-01-23 04:45:44 UTC (rev 36021)
@@ -580,7 +580,7 @@
// If not, try to load the bitmap via the ImageDecoder class.
surf = Graphics::ImageDecoder::loadFile(filename);
if (!surf && _themeArchive) {
- Common::SeekableReadStream *stream = _themeArchive->openFile(filename);
+ Common::SeekableReadStream *stream = _themeArchive->createReadStreamForMember(filename);
if (stream) {
surf = Graphics::ImageDecoder::loadFile(*stream);
delete stream;
@@ -1243,7 +1243,7 @@
const Graphics::Font *font = 0;
if (_themeArchive)
- stream = _themeArchive->openFile(filename);
+ stream = _themeArchive->createReadStreamForMember(filename);
if (stream) {
font = Graphics::NewFont::loadFromCache(*stream);
delete stream;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list