00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef XAPIAN_INCLUDED_POSITIONITERATOR_H
00027 #define XAPIAN_INCLUDED_POSITIONITERATOR_H
00028
00029 #include <iterator>
00030 #include <string>
00031
00032 #include <xapian/base.h>
00033 #include <xapian/types.h>
00034
00035 namespace Xapian {
00036
00037 class Database;
00038 class PostingIterator;
00039 class TermIterator;
00040
00041 class PositionIterator {
00042 private:
00043
00044 friend class PostingIterator;
00045 friend class TermIterator;
00046 friend class Database;
00047
00048 public:
00049 class Internal;
00051 Xapian::Internal::RefCntPtr<Internal> internal;
00052
00053 friend bool operator==(const PositionIterator &a, const PositionIterator &b);
00054
00055
00056 PositionIterator(Internal *internal_);
00057
00059 PositionIterator();
00060
00062 ~PositionIterator();
00063
00067 PositionIterator(const PositionIterator &o);
00068
00072 void operator=(const PositionIterator &o);
00073
00074 Xapian::termpos operator *() const;
00075
00076 PositionIterator & operator++();
00077
00078 void operator++(int);
00079
00080
00081 void skip_to(Xapian::termpos pos);
00082
00086 std::string get_description() const;
00087
00088
00089 typedef std::input_iterator_tag iterator_category;
00090 typedef Xapian::termpos value_type;
00091 typedef Xapian::termpos_diff difference_type;
00092 typedef Xapian::termpos * pointer;
00093 typedef Xapian::termpos & reference;
00094 };
00095
00097 inline bool
00098 operator==(const PositionIterator &a, const PositionIterator &b)
00099 {
00100 return (a.internal.get() == b.internal.get());
00101 }
00102
00104 inline bool
00105 operator!=(const PositionIterator &a, const PositionIterator &b)
00106 {
00107 return !(a == b);
00108 }
00109
00110 }
00111
00112 #endif