3 #include "ParagraphList.h"
7 ////////// The ParagraphList::iterator
9 ParagraphList::iterator::iterator()
14 ParagraphList::iterator::iterator(Paragraph * p)
19 ParagraphList::iterator::reference
20 ParagraphList::iterator::operator*()
26 ParagraphList::iterator::pointer
27 ParagraphList::iterator::operator->()
33 ParagraphList::iterator &
34 ParagraphList::iterator::operator++()
41 ParagraphList::iterator
42 ParagraphList::iterator::operator++(int)
50 ParagraphList::iterator &
51 ParagraphList::iterator::operator--()
53 ptr = ptr->previous();
58 ParagraphList::iterator
59 ParagraphList::iterator::operator--(int)
67 bool operator==(ParagraphList::iterator const & i1,
68 ParagraphList::iterator const & i2)
70 return &(*const_cast<ParagraphList::iterator&>(i1))
71 == &(*const_cast<ParagraphList::iterator&>(i2));
75 bool operator!=(ParagraphList::iterator const & i1,
76 ParagraphList::iterator const & i2)
82 ////////// The ParagraphList proper
83 ParagraphList::ParagraphList()
88 void ParagraphList::clear()
91 Paragraph * tmp = parlist->next();
98 void ParagraphList::erase(ParagraphList::iterator it)
100 Paragraph * prev = it->previous();
101 Paragraph * next = it->next();
104 next->previous(prev);
110 ParagraphList::iterator ParagraphList::begin()
112 return iterator(parlist);
116 ParagraphList::iterator ParagraphList::begin() const
118 return iterator(parlist);
122 ParagraphList::iterator ParagraphList::end()
128 ParagraphList::iterator ParagraphList::end() const
134 void ParagraphList::set(Paragraph * p)
140 void ParagraphList::push_back(Paragraph * p)
147 Paragraph * pos = parlist;
155 int ParagraphList::size() const
157 // When we switch to a std::container this will be O(1)
158 // instead of O(n). (Lgb)
159 Paragraph * tmp = parlist;
169 bool ParagraphList::empty() const