2010-04-13 13:48:02 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2010, Haiku Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _ENTRY_LIST_H
|
|
|
|
#define _ENTRY_LIST_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <dirent.h>
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
|
|
|
class BEntry;
|
|
|
|
struct entry_ref;
|
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
|
|
|
/*! Interface for iterating through a list of filesystem entries
|
|
|
|
Defines a general interface for iterating through a list of entries (i.e.
|
2002-07-09 16:24:59 +04:00
|
|
|
files in a folder
|
|
|
|
*/
|
|
|
|
class BEntryList {
|
|
|
|
public:
|
2010-04-13 13:48:02 +04:00
|
|
|
BEntryList();
|
|
|
|
virtual ~BEntryList();
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
virtual status_t GetNextEntry(BEntry* entry,
|
|
|
|
bool traverse = false) = 0;
|
|
|
|
virtual status_t GetNextRef(entry_ref* ref) = 0;
|
|
|
|
virtual int32 GetNextDirents(struct dirent* direntBuffer,
|
|
|
|
size_t bufferSize,
|
|
|
|
int32 maxEntries = INT_MAX) = 0;
|
|
|
|
virtual status_t Rewind() = 0;
|
|
|
|
virtual int32 CountEntries() = 0;
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
private:
|
2010-04-13 13:48:02 +04:00
|
|
|
virtual void _ReservedEntryList1();
|
|
|
|
virtual void _ReservedEntryList2();
|
|
|
|
virtual void _ReservedEntryList3();
|
|
|
|
virtual void _ReservedEntryList4();
|
|
|
|
virtual void _ReservedEntryList5();
|
|
|
|
virtual void _ReservedEntryList6();
|
|
|
|
virtual void _ReservedEntryList7();
|
|
|
|
virtual void _ReservedEntryList8();
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-08-12 11:24:02 +04:00
|
|
|
#endif // _ENTRY_LIST_H
|
2002-08-12 12:42:01 +04:00
|
|
|
|
|
|
|
|