2 * Copyright 2001-2007, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
9 #include "SupportDefs.h"
14 BList(int32 count
= 20);
15 BList(const BList
& anotherList
);
18 virtual BList
& operator =(const BList
&);
20 /* Adding and removing items. */
21 bool AddItem(const void* item
, int32 index
);
22 bool AddItem(const void* item
);
23 bool AddList(const BList
* list
, int32 index
);
24 bool AddList(const BList
* list
);
25 bool RemoveItem(void* item
);
26 void* RemoveItem(int32 index
);
27 bool RemoveItems(int32 index
, int32 count
);
28 bool ReplaceItem(int32 index
, void* newItem
);
29 virtual void MakeEmpty();
32 void SortItems(int (*compareFunc
)(const void*, const void*));
33 bool SwapItems(int32 indexA
, int32 indexB
);
34 bool MoveItem(int32 fromIndex
, int32 toIndex
);
37 void* ItemAt(int32 index
) const;
38 void* FirstItem() const;
39 void* ItemAtFast(int32
) const;
40 // does not check the array bounds!
42 void* LastItem() const;
46 bool HasItem(void* item
) const;
47 int32
IndexOf(void* item
) const;
48 int32
CountItems() const;
52 void DoForEach(bool (*func
)(void* item
));
53 void DoForEach(bool (*func
)(void* item
, void* arg2
), void *arg2
);
56 bool _ResizeArray(int32 count
);
62 int32 fResizeThreshold
;