2002-08-12 00:15:19 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
|
|
|
|
#ifndef PARAGRAPH_LIST_H
|
|
|
|
#define PARAGRAPH_LIST_H
|
|
|
|
|
|
|
|
#include <iterator>
|
|
|
|
|
|
|
|
class Paragraph;
|
|
|
|
|
|
|
|
///
|
|
|
|
class ParagraphList {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
class iterator {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
typedef std::bidirectional_iterator_tag iterator_category;
|
|
|
|
///
|
|
|
|
typedef Paragraph * value_type;
|
|
|
|
///
|
|
|
|
typedef ptrdiff_t difference_type;
|
|
|
|
///
|
|
|
|
typedef Paragraph * pointer;
|
|
|
|
///
|
|
|
|
typedef Paragraph & reference;
|
|
|
|
///
|
|
|
|
iterator();
|
|
|
|
///
|
|
|
|
iterator(value_type);
|
|
|
|
///
|
|
|
|
reference operator*();
|
|
|
|
///
|
|
|
|
pointer operator->();
|
|
|
|
///
|
|
|
|
iterator & operator++();
|
|
|
|
///
|
|
|
|
iterator operator++(int);
|
|
|
|
///
|
|
|
|
iterator & operator--();
|
|
|
|
///
|
|
|
|
iterator operator--(int);
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
Paragraph * ptr;
|
|
|
|
};
|
|
|
|
///
|
|
|
|
ParagraphList();
|
|
|
|
///
|
2003-03-04 21:40:36 +00:00
|
|
|
iterator insert(iterator it, Paragraph * par);
|
|
|
|
///
|
2002-08-12 00:15:19 +00:00
|
|
|
void clear();
|
|
|
|
///
|
2003-03-04 20:45:02 +00:00
|
|
|
void erase(iterator it);
|
|
|
|
///
|
2002-08-12 00:15:19 +00:00
|
|
|
iterator begin();
|
|
|
|
///
|
|
|
|
iterator begin() const;
|
|
|
|
///
|
|
|
|
iterator end();
|
|
|
|
///
|
|
|
|
iterator end() const;
|
|
|
|
///
|
|
|
|
void set(Paragraph *);
|
|
|
|
///
|
2002-08-13 17:43:40 +00:00
|
|
|
void push_back(Paragraph *);
|
|
|
|
///
|
2003-03-06 21:01:04 +00:00
|
|
|
Paragraph const & front() const;
|
2002-08-20 15:26:52 +00:00
|
|
|
///
|
2003-03-06 21:01:04 +00:00
|
|
|
Paragraph & front();
|
|
|
|
///
|
|
|
|
Paragraph const & back() const;
|
|
|
|
///
|
|
|
|
Paragraph & back();
|
2002-08-20 15:26:52 +00:00
|
|
|
///
|
2002-08-12 00:15:19 +00:00
|
|
|
int size() const;
|
|
|
|
///
|
|
|
|
bool empty() const;
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
Paragraph * parlist;
|
|
|
|
};
|
|
|
|
|
|
|
|
///
|
|
|
|
bool operator==(ParagraphList::iterator const & i1,
|
|
|
|
ParagraphList::iterator const & i2);
|
|
|
|
///
|
|
|
|
bool operator!=(ParagraphList::iterator const & i1,
|
|
|
|
ParagraphList::iterator const & i2);
|
|
|
|
|
|
|
|
#endif
|