diff options
author | Max Horn | 2009-01-23 04:36:18 +0000 |
---|---|---|
committer | Max Horn | 2009-01-23 04:36:18 +0000 |
commit | 9861afd8fde386ffc740ab12fad26f2d41213821 (patch) | |
tree | 1b6c9a50ca8e77b536c56bca99567642304d2b12 /common/fs.h | |
parent | d5c12447bd6240e842a61e3a9d1554c18b506475 (diff) | |
download | scummvm-rg350-9861afd8fde386ffc740ab12fad26f2d41213821.tar.gz scummvm-rg350-9861afd8fde386ffc740ab12fad26f2d41213821.tar.bz2 scummvm-rg350-9861afd8fde386ffc740ab12fad26f2d41213821.zip |
Renamed ArchiveMember::open -> createReadStream, and made it a cv member (const); same for Archive::openFile
svn-id: r36020
Diffstat (limited to 'common/fs.h')
-rw-r--r-- | common/fs.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/common/fs.h b/common/fs.h index 72b492e9c4..61ce21bec5 100644 --- a/common/fs.h +++ b/common/fs.h @@ -223,11 +223,6 @@ public: * @return pointer to the stream object, 0 in case of a failure */ virtual WriteStream *createWriteStream() const; - - // Compatibility with ArchiveMember API. - SeekableReadStream *open() { - return createReadStream(); - } }; /** @@ -262,22 +257,24 @@ public: class FSDirectory : public Archive { FSNode _node; + String _prefix; // string that is prepended to each cache item key + void setPrefix(const String &prefix); + // Caches are case insensitive, clashes are dealt with when creating // Key is stored in lowercase. typedef HashMap<String, FSNode, IgnoreCase_Hash, IgnoreCase_EqualTo> NodeCache; - NodeCache _fileCache, _subDirCache; - String _prefix; // string that is prepended to each cache item key - void setPrefix(const String &prefix); + mutable NodeCache _fileCache, _subDirCache; + mutable bool _cached; + mutable int _depth; // look for a match - FSNode lookupCache(NodeCache &cache, const String &name); + FSNode lookupCache(NodeCache &cache, const String &name) const; // cache management - void cacheDirectoryRecursive(FSNode node, int depth, const String& prefix); + void cacheDirectoryRecursive(FSNode node, int depth, const String& prefix) const; + // fill cache if not already cached - void ensureCached(); - bool _cached; - int _depth; + void ensureCached() const; public: /** @@ -336,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); + virtual SeekableReadStream *openFile(const String &name) const; }; |