]> git.lyx.org Git - features.git/blobdiff - src/ParagraphList.h
parlist-22-a.diff
[features.git] / src / ParagraphList.h
index 6b3f643de9bb7db83dfff28a6e5fb3458a286a80..649106e757117e2ccce30659669c064ec3464dad 100644 (file)
@@ -3,16 +3,30 @@
 #ifndef PARAGRAPH_LIST_H
 #define PARAGRAPH_LIST_H
 
-#include <iterator>
+#define NO_STD_LIST 1
+
+#ifndef NO_STD_LIST
+
+#include "paragraph.h"
+
+#include <list>
+
+typedef std::list<Paragraph> ParagraphList;
+
+#else
 
 class Paragraph;
 
+#include <iterator>
+#include <utility>
+
 ///
 class ParagraphList {
 public:
        ///
        class iterator {
        public:
+               friend class ParagraphList;
                ///
                typedef std::bidirectional_iterator_tag iterator_category;
                ///
@@ -26,8 +40,6 @@ public:
                ///
                iterator();
                ///
-               iterator(value_type);
-               ///
                reference operator*();
                ///
                pointer operator->();
@@ -40,14 +52,32 @@ public:
                ///
                iterator operator--(int);
        private:
+               ///
+               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();
        ///
        iterator begin() const;
@@ -56,9 +86,15 @@ public:
        ///
        iterator end() const;
        ///
-       void set(Paragraph *);
+       void push_back(Paragraph const &);
+       ///
+       Paragraph const & front() const;
+       ///
+       Paragraph & front();
+       ///
+       Paragraph const & back() const;
        ///
-       void push_back(Paragraph *);
+       Paragraph & back();
        ///
        int size() const;
        ///
@@ -68,6 +104,12 @@ private:
        Paragraph * parlist;
 };
 
+
+
+typedef std::pair<ParagraphList::iterator, int> PitPosPair;
+
+
+
 ///
 bool operator==(ParagraphList::iterator const & i1,
                ParagraphList::iterator const & i2);
@@ -76,3 +118,5 @@ bool operator!=(ParagraphList::iterator const & i1,
                ParagraphList::iterator const & i2);
 
 #endif
+
+#endif