From 1a5a709876e1b5e8ed3a5fdf59528445b86cbe50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 12 Sep 2003 07:16:39 +0000 Subject: [PATCH] Implemented the new GetNextEntry() method in the root file system. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4647 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/loader/RootFileSystem.cpp | 17 +++++++++++++++-- src/kernel/boot/loader/RootFileSystem.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/kernel/boot/loader/RootFileSystem.cpp b/src/kernel/boot/loader/RootFileSystem.cpp index fdddb242fd..de6e23782e 100644 --- a/src/kernel/boot/loader/RootFileSystem.cpp +++ b/src/kernel/boot/loader/RootFileSystem.cpp @@ -63,7 +63,7 @@ RootFileSystem::Close(void *cookie) Node * -RootFileSystem::Lookup(const char *name, bool traverseLinks) +RootFileSystem::Lookup(const char *name, bool /*traverseLinks*/) { file_system_entry *entry = NULL; @@ -82,6 +82,20 @@ RootFileSystem::Lookup(const char *name, bool traverseLinks) } +status_t +RootFileSystem::GetNextEntry(void *_cookie, char *name, size_t size) +{ + dir_cookie *cookie = (dir_cookie *)_cookie; + file_system_entry *entry; + + entry = cookie->current = (file_system_entry *)list_get_next_item(&fList, cookie->current); + if (entry != NULL) + return entry->root->GetName(name, size); + + return B_ENTRY_NOT_FOUND; +} + + status_t RootFileSystem::GetNextNode(void *_cookie, Node **_node) { @@ -93,7 +107,6 @@ RootFileSystem::GetNextNode(void *_cookie, Node **_node) *_node = entry->root; return B_OK; } - return B_ENTRY_NOT_FOUND; } diff --git a/src/kernel/boot/loader/RootFileSystem.h b/src/kernel/boot/loader/RootFileSystem.h index 8a379f8fa9..0c920f3fea 100644 --- a/src/kernel/boot/loader/RootFileSystem.h +++ b/src/kernel/boot/loader/RootFileSystem.h @@ -19,6 +19,7 @@ class RootFileSystem : public Directory { virtual Node *Lookup(const char *name, bool traverseLinks); + virtual status_t GetNextEntry(void *cookie, char *nameBuffer, size_t bufferSize); virtual status_t GetNextNode(void *cookie, Node **_node); virtual status_t Rewind(void *cookie);