status_t TarFS::Directory::GetNextEntry(void* _cookie, char* name, size_t size) { EntryIterator* iterator = (EntryIterator*)_cookie; TarFS::Entry* entry = iterator->Next(); if (entry != NULL) { strlcpy(name, entry->Name(), size); return B_OK; } return B_ENTRY_NOT_FOUND; }
TarFS::Entry* TarFS::Directory::LookupEntry(const char* name) { EntryIterator iterator(fEntries.GetIterator()); while (iterator.HasNext()) { TarFS::Entry* entry = iterator.Next(); if (strcmp(name, entry->Name()) == 0) return entry; } return NULL; }