xref: /haiku/src/kits/tracker/VirtualDirectoryEntryList.h (revision 09d0d8f9dc88c79ab8a7a4c9018e48732ba25718)
11c29b26eSIngo Weinhold /*
21c29b26eSIngo Weinhold  * Copyright 2013, Haiku, Inc.
31c29b26eSIngo Weinhold  * Distributed under the terms of the MIT License.
41c29b26eSIngo Weinhold  *
51c29b26eSIngo Weinhold  * Authors:
61c29b26eSIngo Weinhold  *		Ingo Weinhold, ingo_weinhold@gmx.de
71c29b26eSIngo Weinhold  */
8*09d0d8f9SJohn Scipione #ifndef _VIRTUAL_DIRECTORY_ENTRY_LIST_H
9*09d0d8f9SJohn Scipione #define _VIRTUAL_DIRECTORY_ENTRY_LIST_H
101c29b26eSIngo Weinhold 
111c29b26eSIngo Weinhold 
121c29b26eSIngo Weinhold #include <StringList.h>
131c29b26eSIngo Weinhold 
141c29b26eSIngo Weinhold #include <MergedDirectory.h>
151c29b26eSIngo Weinhold 
161c29b26eSIngo Weinhold #include "EntryIterator.h"
171c29b26eSIngo Weinhold 
181c29b26eSIngo Weinhold 
191c29b26eSIngo Weinhold namespace BPrivate {
201c29b26eSIngo Weinhold 
211c29b26eSIngo Weinhold class Model;
221c29b26eSIngo Weinhold 
231c29b26eSIngo Weinhold class VirtualDirectoryEntryList : public EntryListBase {
241c29b26eSIngo Weinhold public:
251c29b26eSIngo Weinhold 								VirtualDirectoryEntryList(Model* model);
261c29b26eSIngo Weinhold 								VirtualDirectoryEntryList(
271c29b26eSIngo Weinhold 									const node_ref& definitionFileRef,
281c29b26eSIngo Weinhold 									const BStringList& directoryPaths);
291c29b26eSIngo Weinhold 	virtual						~VirtualDirectoryEntryList();
301c29b26eSIngo Weinhold 
311c29b26eSIngo Weinhold 	virtual	status_t			InitCheck() const;
321c29b26eSIngo Weinhold 
331c29b26eSIngo Weinhold 	virtual	status_t			GetNextEntry(BEntry* entry,
341c29b26eSIngo Weinhold 									bool traverse = false);
351c29b26eSIngo Weinhold 	virtual	status_t			GetNextRef(entry_ref* ref);
361c29b26eSIngo Weinhold 	virtual	int32				GetNextDirents(struct dirent* buffer,
371c29b26eSIngo Weinhold 									size_t length, int32 count = INT_MAX);
381c29b26eSIngo Weinhold 
391c29b26eSIngo Weinhold 	virtual	status_t			Rewind();
401c29b26eSIngo Weinhold 	virtual	int32				CountEntries();
411c29b26eSIngo Weinhold 
421c29b26eSIngo Weinhold private:
431c29b26eSIngo Weinhold 
441c29b26eSIngo Weinhold 			status_t			_InitMergedDirectory(
451c29b26eSIngo Weinhold 									const BStringList& directoryPaths);
461c29b26eSIngo Weinhold private:
471c29b26eSIngo Weinhold 			node_ref			fDefinitionFileRef;
481c29b26eSIngo Weinhold 			BMergedDirectory	fMergedDirectory;
491c29b26eSIngo Weinhold };
501c29b26eSIngo Weinhold 
511c29b26eSIngo Weinhold } // namespace BPrivate
521c29b26eSIngo Weinhold 
531c29b26eSIngo Weinhold 
54*09d0d8f9SJohn Scipione #endif	// _VIRTUAL_DIRECTORY_ENTRY_LIST_H
55