Diffstat (limited to 'noncore/apps/opie-reader/my_list.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/my_list.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/my_list.h b/noncore/apps/opie-reader/my_list.h index b3f0cc0..f180d3d 100644 --- a/noncore/apps/opie-reader/my_list.h +++ b/noncore/apps/opie-reader/my_list.h @@ -27,8 +27,10 @@ class CList delete p; } } } + T& first() { return front->data; } + T& last() { return back->data; } T* operator[](int n) { node* current = front; while (n-- > 0) @@ -60,8 +62,9 @@ class CList back->next = n; back = n; } } + bool isEmpty() { return (front == NULL); } void erase(unsigned int n) { node* p = front; node* last = front; @@ -154,12 +157,20 @@ class CList T* operator->() { return &(current->data); } + T* pContent() + { + return &(current->data); + } bool operator!=(iterator t) { return (current != t.current); } + bool operator==(iterator t) + { + return (current == t.current); + } }; iterator begin() { return iterator(front); |