| Index: src/list.h
|
| diff --git a/src/list.h b/src/list.h
|
| index 24f34945b54d2fb7f90de95bac1ecf701ecc6d5d..9a2e69897b1f65d0005fca89c0ca349531af6ce3 100644
|
| --- a/src/list.h
|
| +++ b/src/list.h
|
| @@ -91,6 +91,9 @@ class List {
|
| // Add all the elements from the argument list to this list.
|
| void AddAll(const List<T, P>& other);
|
|
|
| + // Inserts the element at the specific index.
|
| + void InsertAt(int index, const T& element);
|
| +
|
| // Added 'count' elements with the value 'value' and returns a
|
| // vector that allows access to the elements. The vector is valid
|
| // until the next change is made to this list.
|
| @@ -102,6 +105,10 @@ class List {
|
| // size of the list.
|
| T Remove(int i);
|
|
|
| + // Remove the given element from the list. Returns whether or not
|
| + // the input is included in the list in the first place.
|
| + bool RemoveElement(const T& elm);
|
| +
|
| // Removes the last element without deleting it even if T is a
|
| // pointer type. Returns the removed element.
|
| INLINE(T RemoveLast()) { return Remove(length_ - 1); }
|
| @@ -113,7 +120,11 @@ class List {
|
| // Drops all but the first 'pos' elements from the list.
|
| INLINE(void Rewind(int pos));
|
|
|
| - bool Contains(const T& elm);
|
| + // Drop the last 'count' elements from the list.
|
| + INLINE(void RewindBy(int count)) { Rewind(length_ - count); }
|
| +
|
| + bool Contains(const T& elm) const;
|
| + int CountOccurrences(const T& elm, int start, int end) const;
|
|
|
| // Iterate through all list entries, starting at index 0.
|
| void Iterate(void (*callback)(T* x));
|
|
|