Added an optional depth parameter to FSDirectory::getSubDirectory(), so that returned FSDirectory can be more flexibly configured.

svn-id: r34756
This commit is contained in:
Nicola Mettifogo 2008-10-08 09:05:21 +00:00
parent 6a2f3dc0b9
commit 5dd381932f
2 changed files with 3 additions and 3 deletions

View File

@ -156,13 +156,13 @@ SeekableReadStream *FSDirectory::openFile(const String &name) {
return stream;
}
FSDirectory *FSDirectory::getSubDirectory(const String &name) {
FSDirectory *FSDirectory::getSubDirectory(const String &name, int depth) {
if (name.empty() || !_node.isDirectory()) {
return 0;
}
FSNode node = lookupCache(_subDirCache, name);
return new FSDirectory(node);
return new FSDirectory(node, depth);
}
void FSDirectory::cacheDirectoryRecursive(FSNode node, int depth, const String& prefix) {

View File

@ -164,7 +164,7 @@ public:
* Create a new FSDirectory pointing to a sub directory of the instance.
* @return a new FSDirectory instance
*/
FSDirectory *getSubDirectory(const String &name);
FSDirectory *getSubDirectory(const String &name, int depth = 1);
virtual bool hasFile(const String &name);
virtual int listMatchingMembers(ArchiveMemberList &list, const String &pattern);