diff options
author | Max Horn | 2008-11-21 12:17:35 +0000 |
---|---|---|
committer | Max Horn | 2008-11-21 12:17:35 +0000 |
commit | a28b531ed0a984aa89a6cbc55c0314ad52f304fb (patch) | |
tree | 492d7aae224da496b3d3f176833da02c617bb0f9 /common/archive.cpp | |
parent | 33dd58ca9894676c52498498eb5d19e48e3cc998 (diff) | |
download | scummvm-rg350-a28b531ed0a984aa89a6cbc55c0314ad52f304fb.tar.gz scummvm-rg350-a28b531ed0a984aa89a6cbc55c0314ad52f304fb.tar.bz2 scummvm-rg350-a28b531ed0a984aa89a6cbc55c0314ad52f304fb.zip |
Added ArchiveMember::getDisplayName() method; changed ArchiveMember::getName() to always return a name compatible with Archive::openFile()
svn-id: r35139
Diffstat (limited to 'common/archive.cpp')
-rw-r--r-- | common/archive.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/common/archive.cpp b/common/archive.cpp index d494c6ceb4..85586c2820 100644 --- a/common/archive.cpp +++ b/common/archive.cpp @@ -76,14 +76,11 @@ public: FSDirectoryMember(FSNode &node) : _node(node) { } - /* - NOTE/FIXME: since I assume that the only use case for getName() - is for error messages, I am returning the full path of the node - here. This seems better than we did before, when matchPattern - and getAllNames used to work with StringList, and we used to - put the relative path of the file to the list instead. - */ String getName() const { + return _node.getName(); + } + + String getDisplayName() const { return _node.getPath(); } @@ -92,8 +89,6 @@ public: } }; -typedef SharedPtr<FSDirectoryMember> FSDirectoryMemberPtr; - FSDirectory::FSDirectory(const FSNode &node, int depth) : _node(node), _cached(false), _depth(depth) { } @@ -259,7 +254,7 @@ int FSDirectory::listMatchingMembers(ArchiveMemberList &list, const String &patt NodeCache::iterator it = _fileCache.begin(); for ( ; it != _fileCache.end(); it++) { if ((*it)._key.matchString(lowercasePattern)) { - list.push_back(FSDirectoryMemberPtr(new FSDirectoryMember((*it)._value))); + list.push_back(ArchiveMemberPtr(new FSDirectoryMember((*it)._value))); matches++; } } |