1 /* 2 * Copyright 2013, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold, ingo_weinhold@gmx.de 7 */ 8 #ifndef VIRTUAL_DIRECTORY_ENTRY_LIST_H 9 #define VIRTUAL_DIRECTORY_ENTRY_LIST_H 10 11 12 #include <StringList.h> 13 14 #include <MergedDirectory.h> 15 16 #include "EntryIterator.h" 17 18 19 namespace BPrivate { 20 21 22 class Model; 23 24 25 class VirtualDirectoryEntryList : public EntryListBase { 26 public: 27 VirtualDirectoryEntryList(Model* model); 28 VirtualDirectoryEntryList( 29 const node_ref& definitionFileRef, 30 const BStringList& directoryPaths); 31 virtual ~VirtualDirectoryEntryList(); 32 33 virtual status_t InitCheck() const; 34 35 virtual status_t GetNextEntry(BEntry* entry, 36 bool traverse = false); 37 virtual status_t GetNextRef(entry_ref* ref); 38 virtual int32 GetNextDirents(struct dirent* buffer, 39 size_t length, int32 count = INT_MAX); 40 41 virtual status_t Rewind(); 42 virtual int32 CountEntries(); 43 44 private: 45 46 status_t _InitMergedDirectory( 47 const BStringList& directoryPaths); 48 private: 49 node_ref fDefinitionFileRef; 50 BMergedDirectory fMergedDirectory; 51 }; 52 53 54 } // namespace BPrivate 55 56 57 #endif // VIRTUAL_DIRECTORY_ENTRY_LIST_H 58