haiku/headers/os/support/List.h
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00

54 lines
1.2 KiB
C++

// List.h
// Just here to be able to compile and test BResources.
// To be replaced by the OpenBeOS version to be provided by the IK Team.
#ifndef _sk_list_h_
#define _sk_list_h_
#include <SupportDefs.h>
class BList {
public:
BList(int32 count = 20);
BList(const BList& anotherList);
virtual ~BList();
bool AddItem(void *item, int32 index);
bool AddItem(void *item);
bool AddList(BList *list, int32 index);
bool AddList(BList *list);
int32 CountItems() const;
void DoForEach(bool (*func)(void *));
void DoForEach(bool (*func)(void *, void *), void *arg2);
void *FirstItem() const;
bool HasItem(void *item) const;
int32 IndexOf(void *item) const;
bool IsEmpty() const;
void *ItemAt(int32 index) const;
void *Items() const;
void *LastItem() const;
void MakeEmpty();
bool RemoveItem(void *item);
void *RemoveItem(int32 index);
bool RemoveItems(int32 index, int32 count);
void SortItems(int (*compareFunc)(const void *, const void *));
BList& operator =(const BList &);
private:
virtual void _ReservedList1();
virtual void _ReservedList2();
// return type differs from BeOS version
bool Resize(int32 count);
private:
void** fObjectList;
size_t fPhysicalSize;
int32 fItemCount;
int32 fBlockSize;
uint32 _reserved[2];
};
#endif // _sk_list_h_