X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraphList.h;h=a57deb4eea7b2a7e8582ef7cdedeb1deb62176f0;hb=7950ace3d96543e3099aa3bde823f970a1ce6a86;hp=95cacfb2c92be5cf44ac846de843cb5464e33f5e;hpb=d5f3bad9bb4cc649d6cafc71ade744588ab87612;p=lyx.git diff --git a/src/ParagraphList.h b/src/ParagraphList.h index 95cacfb2c9..a57deb4eea 100644 --- a/src/ParagraphList.h +++ b/src/ParagraphList.h @@ -1,167 +1,36 @@ // -*- C++ -*- +/** + * \file ParagraphList.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Angus Leeming + * + * Full author contact details are available in file CREDITS. + */ #ifndef PARAGRAPH_LIST_H #define PARAGRAPH_LIST_H -//#define NO_STD_LIST 1 +#include "Paragraph.h" -#ifndef NO_STD_LIST +#include "support/RandomAccessList.h" -#include "paragraph.h" -#include +namespace lyx { -struct ParagraphList : public std::list -{ -}; - -typedef std::pair PitPosPair; - -#else - -class Paragraph; - -#include -#include - -/// -class ParagraphList { +/// Container for all kind of Paragraphs used in LyX. +class ParagraphList : public RandomAccessList { public: /// - class iterator { - public: - friend class ParagraphList; - /// - typedef std::bidirectional_iterator_tag iterator_category; - /// - typedef Paragraph * value_type; - /// - typedef ptrdiff_t difference_type; - /// - typedef Paragraph * pointer; - /// - typedef Paragraph & reference; - /// - iterator(); - /// - reference operator*(); - /// - pointer operator->(); - /// - iterator & operator++(); - /// - iterator operator++(int); - /// - iterator & operator--(); - /// - iterator operator--(int); - private: - /// - iterator(value_type); - /// - Paragraph * ptr; - }; - /// - class const_iterator { - public: - friend class ParagraphList; - /// - typedef std::bidirectional_iterator_tag iterator_category; - /// - typedef Paragraph * value_type; - /// - typedef ptrdiff_t difference_type; - /// - typedef Paragraph const * const_pointer; - /// - typedef Paragraph const & const_reference; - /// - const_iterator(); - /// - const_reference operator*(); - /// - const_pointer operator->(); - /// - const_iterator & operator++(); - /// - const_iterator operator++(int); - /// - const_iterator & operator--(); - /// - const_iterator operator--(int); - private: - /// - const_iterator(value_type); - /// - Paragraph * ptr; - }; - /// - ParagraphList(); - /// - ParagraphList(ParagraphList const &); - /// - ParagraphList & operator=(ParagraphList const &); - /// - iterator insert(iterator it, Paragraph const & par); - /// - void insert(iterator pos, iterator beg, iterator end); - /// - void assign(iterator beg, iterator end); - /// - void splice(iterator pos, ParagraphList & pl); - /// - void clear(); - /// - iterator erase(iterator it); - /// - iterator erase(iterator first, iterator last); - /// - iterator begin(); + ParagraphList() {} /// - const_iterator begin() const; - /// - iterator end(); - /// - const_iterator end() const; - /// - void push_back(Paragraph const &); - /// - Paragraph const & front() const; - /// - Paragraph & front(); - /// - Paragraph const & back() const; - /// - Paragraph & back(); - /// - int size() const; - /// - bool empty() const; -private: - /// - Paragraph * parlist; + template + ParagraphList(InputIterator first, InputIterator last) + : RandomAccessList(first, last) + {} }; - - -typedef std::pair PitPosPair; - - - -/// -bool operator==(ParagraphList::iterator const & i1, - ParagraphList::iterator const & i2); -/// -bool operator!=(ParagraphList::iterator const & i1, - ParagraphList::iterator const & i2); - -/// -bool operator==(ParagraphList::const_iterator const & i1, - ParagraphList::const_iterator const & i2); -/// -bool operator!=(ParagraphList::const_iterator const & i1, - ParagraphList::const_iterator const & i2); - -#endif +} // namespace lyx #endif