00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef XAPIAN_INCLUDED_TERMITERATOR_H
00025 #define XAPIAN_INCLUDED_TERMITERATOR_H
00026
00027 #include <iterator>
00028 #include <string>
00029
00030 #include <xapian/base.h>
00031 #include <xapian/derefwrapper.h>
00032 #include <xapian/types.h>
00033 #include <xapian/positioniterator.h>
00034 #include <xapian/visibility.h>
00035
00036 namespace Xapian {
00037
00038 class Database;
00039
00042 class XAPIAN_VISIBILITY_DEFAULT TermIterator {
00043 public:
00044 class Internal;
00046 Xapian::Internal::RefCntPtr<Internal> internal;
00047
00049 explicit TermIterator(Internal *internal_);
00050
00052 TermIterator();
00053
00055 ~TermIterator();
00056
00060 TermIterator(const TermIterator &other);
00061
00065 void operator=(const TermIterator &other);
00066
00068 std::string operator *() const;
00069
00070 TermIterator & operator++();
00071
00072 DerefStringWrapper_ operator++(int) {
00073 std::string term(**this);
00074 operator++();
00075 return DerefStringWrapper_(term);
00076 }
00077
00081 void skip_to(const std::string & tname);
00082
00088 Xapian::termcount get_wdf() const;
00089
00094 Xapian::doccount get_termfreq() const;
00095
00098 Xapian::termcount positionlist_count() const;
00099
00103 PositionIterator positionlist_begin() const;
00104
00108 PositionIterator positionlist_end() const {
00109 return PositionIterator(NULL);
00110 }
00111
00113 std::string get_description() const;
00114
00116
00117 typedef std::input_iterator_tag iterator_category;
00118 typedef std::string value_type;
00119 typedef Xapian::termcount_diff difference_type;
00120 typedef std::string * pointer;
00121 typedef std::string & reference;
00123 };
00124
00125 inline bool
00126 operator==(const TermIterator &a, const TermIterator &b)
00127 {
00128 return (a.internal.get() == b.internal.get());
00129 }
00130
00131 inline bool
00132 operator!=(const TermIterator &a, const TermIterator &b)
00133 {
00134 return !(a == b);
00135 }
00136
00137 }
00138
00139 #endif