xref: /haiku/src/kits/tracker/VirtualDirectoryEntryList.h (revision 09d0d8f9dc88c79ab8a7a4c9018e48732ba25718)
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 class Model;
22 
23 class VirtualDirectoryEntryList : public EntryListBase {
24 public:
25 								VirtualDirectoryEntryList(Model* model);
26 								VirtualDirectoryEntryList(
27 									const node_ref& definitionFileRef,
28 									const BStringList& directoryPaths);
29 	virtual						~VirtualDirectoryEntryList();
30 
31 	virtual	status_t			InitCheck() const;
32 
33 	virtual	status_t			GetNextEntry(BEntry* entry,
34 									bool traverse = false);
35 	virtual	status_t			GetNextRef(entry_ref* ref);
36 	virtual	int32				GetNextDirents(struct dirent* buffer,
37 									size_t length, int32 count = INT_MAX);
38 
39 	virtual	status_t			Rewind();
40 	virtual	int32				CountEntries();
41 
42 private:
43 
44 			status_t			_InitMergedDirectory(
45 									const BStringList& directoryPaths);
46 private:
47 			node_ref			fDefinitionFileRef;
48 			BMergedDirectory	fMergedDirectory;
49 };
50 
51 } // namespace BPrivate
52 
53 
54 #endif	// _VIRTUAL_DIRECTORY_ENTRY_LIST_H
55