1 #ifndef __FILTEREDQUERY_H
2 #define __FILTEREDQUERY_H
6 #include "ObjectList.h"
8 typedef bool (*filter_function
)(const entry_ref
*ref
, void *arg
);
11 filter_function filter
;
14 filter_pair(filter_function function
, void *arguments
)
22 class TFilteredQuery
: public BQuery
{
26 // BQuery doesn't have a copy constructor. We supply
27 // this method to workaround this problem
28 TFilteredQuery(const BQuery
&query
);
29 TFilteredQuery(const TFilteredQuery
&query
);
30 virtual ~TFilteredQuery();
32 bool AddFilter(filter_function function
, void *arg
);
33 void RemoveFilter(filter_function function
);
35 virtual status_t
GetNextRef(entry_ref
*ref
);
36 virtual status_t
GetNextEntry(BEntry
*entry
, bool traverse
= false);
37 virtual int32
GetNextDirents(dirent
*buf
, size_t length
, int32 count
= INT_MAX
);
42 BObjectList
<filter_pair
> fFilters
;
45 #endif //__FILTEREDQUERY_H