2001-09-01 21:26:34 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-05-21 21:20:50 +00:00
|
|
|
|
/* \file iterators.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author unknown
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
|
*/
|
2001-09-01 21:26:34 +00:00
|
|
|
|
|
|
|
|
|
#ifndef ITERATORS_H
|
|
|
|
|
#define ITERATORS_H
|
|
|
|
|
|
2003-05-21 21:20:50 +00:00
|
|
|
|
#include "ParagraphList.h"
|
2001-09-01 21:26:34 +00:00
|
|
|
|
|
2003-05-21 21:20:50 +00:00
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
2001-09-01 21:26:34 +00:00
|
|
|
|
|
|
|
|
|
class ParIterator {
|
|
|
|
|
public:
|
2002-02-16 15:59:55 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
ParIterator(ParagraphList::iterator pit, ParagraphList const & pl);
|
2001-09-01 21:26:34 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
~ParIterator();
|
2002-02-16 15:59:55 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
ParIterator(ParIterator const &);
|
2001-09-01 21:26:34 +00:00
|
|
|
|
///
|
2003-05-22 15:16:58 +00:00
|
|
|
|
void operator=(ParIterator const &);
|
|
|
|
|
///
|
2001-09-01 21:26:34 +00:00
|
|
|
|
ParIterator & operator++();
|
|
|
|
|
///
|
2003-05-22 08:01:41 +00:00
|
|
|
|
ParagraphList::iterator operator*() const;
|
2003-05-21 21:20:50 +00:00
|
|
|
|
///
|
2003-05-22 08:01:41 +00:00
|
|
|
|
ParagraphList::iterator operator->() const;
|
2003-05-23 10:33:40 +00:00
|
|
|
|
///
|
|
|
|
|
ParagraphList & plist() const;
|
2001-09-01 21:26:34 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
size_t size() const;
|
2001-09-01 21:26:34 +00:00
|
|
|
|
///
|
|
|
|
|
friend
|
|
|
|
|
bool operator==(ParIterator const & iter1, ParIterator const & iter2);
|
|
|
|
|
private:
|
2003-05-21 21:20:50 +00:00
|
|
|
|
struct Pimpl;
|
|
|
|
|
boost::scoped_ptr<Pimpl> pimpl_;
|
2001-09-01 21:26:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
bool operator==(ParIterator const & iter1, ParIterator const & iter2);
|
2001-09-01 21:26:34 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
bool operator!=(ParIterator const & iter1, ParIterator const & iter2);
|
2001-09-01 21:26:34 +00:00
|
|
|
|
|
2002-11-08 01:08:27 +00:00
|
|
|
|
|
|
|
|
|
class ParConstIterator {
|
|
|
|
|
public:
|
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
ParConstIterator(ParagraphList::iterator pit, ParagraphList const & pl);
|
2002-11-08 01:08:27 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
~ParConstIterator();
|
2002-11-08 01:08:27 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
ParConstIterator(ParConstIterator const &);
|
2002-11-08 01:08:27 +00:00
|
|
|
|
///
|
|
|
|
|
ParConstIterator & operator++();
|
|
|
|
|
///
|
2003-05-22 08:01:41 +00:00
|
|
|
|
ParagraphList::iterator operator*() const;
|
2003-05-21 21:20:50 +00:00
|
|
|
|
///
|
2003-05-22 08:01:41 +00:00
|
|
|
|
ParagraphList::iterator operator->() const;
|
2003-05-21 21:20:50 +00:00
|
|
|
|
|
2002-11-08 01:08:27 +00:00
|
|
|
|
///
|
2003-05-21 21:20:50 +00:00
|
|
|
|
size_t size() const;
|
2002-11-08 01:08:27 +00:00
|
|
|
|
///
|
|
|
|
|
friend
|
|
|
|
|
bool operator==(ParConstIterator const & iter1,
|
|
|
|
|
ParConstIterator const & iter2);
|
|
|
|
|
private:
|
2003-05-21 21:20:50 +00:00
|
|
|
|
struct Pimpl;
|
|
|
|
|
boost::scoped_ptr<Pimpl> pimpl_;
|
2002-11-08 01:08:27 +00:00
|
|
|
|
};
|
|
|
|
|
|
2003-05-21 21:20:50 +00:00
|
|
|
|
bool operator==(ParConstIterator const & iter1,
|
|
|
|
|
ParConstIterator const & iter2);
|
2002-11-08 01:08:27 +00:00
|
|
|
|
|
2003-05-21 21:20:50 +00:00
|
|
|
|
bool operator!=(ParConstIterator const & iter1,
|
|
|
|
|
ParConstIterator const & iter2);
|
2002-11-08 01:08:27 +00:00
|
|
|
|
|
2001-09-01 21:26:34 +00:00
|
|
|
|
#endif
|