3 #ifndef PARAGRAPH_LIST_H
4 #define PARAGRAPH_LIST_H
10 #include "paragraph.h"
14 typedef std::list<Paragraph> ParagraphList;
29 friend class ParagraphList;
31 typedef std::bidirectional_iterator_tag iterator_category;
33 typedef Paragraph * value_type;
35 typedef ptrdiff_t difference_type;
37 typedef Paragraph * pointer;
39 typedef Paragraph & reference;
43 reference operator*();
47 iterator & operator++();
49 iterator operator++(int);
51 iterator & operator--();
53 iterator operator--(int);
61 class const_iterator {
63 friend class ParagraphList;
65 typedef std::bidirectional_iterator_tag iterator_category;
67 typedef Paragraph * value_type;
69 typedef ptrdiff_t difference_type;
71 typedef Paragraph const * const_pointer;
73 typedef Paragraph const & const_reference;
77 const_reference operator*();
79 const_pointer operator->();
81 const_iterator & operator++();
83 const_iterator operator++(int);
85 const_iterator & operator--();
87 const_iterator operator--(int);
90 const_iterator(value_type);
97 ParagraphList(ParagraphList const &);
99 ParagraphList & operator=(ParagraphList const &);
101 iterator insert(iterator it, Paragraph const & par);
103 void insert(iterator pos, iterator beg, iterator end);
105 void assign(iterator beg, iterator end);
107 void splice(iterator pos, ParagraphList & pl);
111 iterator erase(iterator it);
113 iterator erase(iterator first, iterator last);
117 const_iterator begin() const;
121 const_iterator end() const;
123 void push_back(Paragraph const &);
125 Paragraph const & front() const;
129 Paragraph const & back() const;
143 typedef std::pair<ParagraphList::iterator, int> PitPosPair;
148 bool operator==(ParagraphList::iterator const & i1,
149 ParagraphList::iterator const & i2);
151 bool operator!=(ParagraphList::iterator const & i1,
152 ParagraphList::iterator const & i2);
155 bool operator==(ParagraphList::const_iterator const & i1,
156 ParagraphList::const_iterator const & i2);
158 bool operator!=(ParagraphList::const_iterator const & i1,
159 ParagraphList::const_iterator const & i2);