Add MoveItem method to easily move a item within a list. Fix line limit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42475 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -101,6 +101,7 @@ public:
|
||||
|
||||
bool Owning() const;
|
||||
bool ReplaceItem(int32, void *);
|
||||
bool MoveItem(int32 from, int32 to);
|
||||
|
||||
protected:
|
||||
bool owning;
|
||||
@@ -154,6 +155,7 @@ public:
|
||||
// same as ReplaceItem, except does not
|
||||
// delete old item at <index>, returns it
|
||||
// instead
|
||||
bool MoveItem(int32 from, int32 to);
|
||||
|
||||
T* FirstItem() const;
|
||||
T* LastItem() const;
|
||||
@@ -552,6 +554,14 @@ BObjectList<T>::SwapWithItem(int32 index, T* newItem)
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
bool
|
||||
BObjectList<T>::MoveItem(int32 from, int32 to)
|
||||
{
|
||||
return _PointerList_::MoveItem(from, to);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
void
|
||||
BObjectList<T>::_SetItem(int32 index, T* newItem)
|
||||
|
||||
Reference in New Issue
Block a user