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:
Clemens Zeidler
2011-07-24 23:49:30 +00:00
parent 811ac4d502
commit f7953fa769
2 changed files with 49 additions and 9 deletions
+10
View File
@@ -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)