xref: /haiku/headers/os/storage/EntryList.h (revision c90684742e7361651849be4116d0e5de3a817194)
1 /*
2  * Copyright 2001-2010, Haiku Inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ENTRY_LIST_H
6 #define _ENTRY_LIST_H
7 
8 
9 #include <dirent.h>
10 
11 #include <SupportDefs.h>
12 
13 
14 class BEntry;
15 struct entry_ref;
16 
17 
18 /*! Interface for iterating through a list of filesystem entries
19 	Defines a general interface for iterating through a list of entries (i.e.
20 	files in a folder
21 */
22 class BEntryList {
23 public:
24 								BEntryList();
25 	virtual						~BEntryList();
26 
27 	virtual status_t			GetNextEntry(BEntry* entry,
28 									bool traverse = false) = 0;
29 	virtual status_t			GetNextRef(entry_ref* ref) = 0;
30 	virtual int32				GetNextDirents(struct dirent* direntBuffer,
31 									size_t bufferSize,
32 									int32 maxEntries = INT_MAX) = 0;
33 	virtual status_t			Rewind() = 0;
34 	virtual int32				CountEntries() = 0;
35 
36 private:
37 	virtual	void				_ReservedEntryList1();
38 	virtual	void				_ReservedEntryList2();
39 	virtual	void				_ReservedEntryList3();
40 	virtual	void				_ReservedEntryList4();
41 	virtual	void				_ReservedEntryList5();
42 	virtual	void				_ReservedEntryList6();
43 	virtual	void				_ReservedEntryList7();
44 	virtual	void				_ReservedEntryList8();
45 };
46 
47 
48 #endif	// _ENTRY_LIST_H
49 
50 
51