diff options
author | Max Horn | 2009-01-23 04:45:44 +0000 |
---|---|---|
committer | Max Horn | 2009-01-23 04:45:44 +0000 |
commit | 14c5bbbccf30f333b92092ca55063b338335c3a5 (patch) | |
tree | 80cfc99351a2333461bbbb6e9437780921ad2edb /common | |
parent | 9861afd8fde386ffc740ab12fad26f2d41213821 (diff) | |
download | scummvm-rg350-14c5bbbccf30f333b92092ca55063b338335c3a5.tar.gz scummvm-rg350-14c5bbbccf30f333b92092ca55063b338335c3a5.tar.bz2 scummvm-rg350-14c5bbbccf30f333b92092ca55063b338335c3a5.zip |
Renamed Archive::openFile to createReadStreamForMember
svn-id: r36021
Diffstat (limited to 'common')
-rw-r--r-- | common/archive.cpp | 14 | ||||
-rw-r--r-- | common/archive.h | 10 | ||||
-rw-r--r-- | common/file.cpp | 4 | ||||
-rw-r--r-- | common/fs.h | 4 | ||||
-rw-r--r-- | common/unarj.cpp | 2 | ||||
-rw-r--r-- | common/unzip.cpp | 4 | ||||
-rw-r--r-- | common/unzip.h | 2 | ||||
-rw-r--r-- | common/xmlparser.cpp | 2 |
8 files changed, 21 insertions, 21 deletions
diff --git a/common/archive.cpp b/common/archive.cpp index 614215685a..d8b2c61dd1 100644 --- a/common/archive.cpp +++ b/common/archive.cpp @@ -39,7 +39,7 @@ String GenericArchiveMember::getName() const { } SeekableReadStream *GenericArchiveMember::createReadStream() const { - return _parent->openFile(_name); + return _parent->createReadStreamForMember(_name); } @@ -136,23 +136,23 @@ ArchiveMemberPtr FSDirectory::getMember(const String &name) { 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 @@ ArchiveMemberPtr SearchSet::getMember(const String &name) { 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; diff --git a/common/archive.h b/common/archive.h index ea556d199f..36bc5bc7c9 100644 --- a/common/archive.h +++ b/common/archive.h @@ -95,7 +95,7 @@ public: /** * 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 @@ public: /** * 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 @@ public: * 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 @@ public: 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; }; diff --git a/common/file.cpp b/common/file.cpp index 6184004b35..0cec608d89 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -62,12 +62,12 @@ bool File::open(const String &filename, Archive &archive) { 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); diff --git a/common/fs.h b/common/fs.h index 61ce21bec5..b8e6aeecc4 100644 --- a/common/fs.h +++ b/common/fs.h @@ -243,7 +243,7 @@ public: * 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 @@ public: * 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; }; diff --git a/common/unarj.cpp b/common/unarj.cpp index e69869a720..4a969a6ef0 100644 --- a/common/unarj.cpp +++ b/common/unarj.cpp @@ -350,7 +350,7 @@ bool ArjFile::open(const Common::String &filename) { error("Attempt to open another instance of archive"); if (_fallBack) { - _uncompressed = SearchMan.openFile(filename); + _uncompressed = SearchMan.createReadStreamForMember(filename); if (_uncompressed) return true; } diff --git a/common/unzip.cpp b/common/unzip.cpp index 9b102872f8..0fff54fbe3 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -1376,7 +1376,7 @@ public: */ ZipArchive::ZipArchive(const Common::String &name) { - SeekableReadStream *stream = SearchMan.openFile(name); + SeekableReadStream *stream = SearchMan.createReadStreamForMember(name); _zipFile = unzOpen(stream); } @@ -1428,7 +1428,7 @@ ArchiveMemberPtr ZipArchive::getMember(const String &name) { 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; diff --git a/common/unzip.h b/common/unzip.h index 970a84ad57..94d098208a 100644 --- a/common/unzip.h +++ b/common/unzip.h @@ -62,7 +62,7 @@ public: 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 diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index 10085d3b8e..1385af795b 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -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; |