00001 00004 /* Copyright (C) 2007 Olly Betts 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License as 00008 * published by the Free Software Foundation; either version 2 of the 00009 * License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #ifndef XAPIAN_INCLUDED_TERMLIST_H 00022 #define XAPIAN_INCLUDED_TERMLIST_H 00023 00024 #include <string> 00025 00026 #include <xapian/base.h> 00027 #include <xapian/types.h> 00028 #include <xapian/termiterator.h> 00029 00030 namespace Xapian { 00031 class PositionIterator; 00032 namespace Internal { 00033 class ExpandStats; 00034 } 00035 } 00036 00038 class Xapian::TermIterator::Internal : public Xapian::Internal::RefCntBase { 00040 void operator=(const Internal &); 00041 00043 Internal(const Internal &); 00044 00045 protected: 00047 Internal() { } 00048 00049 public: 00053 virtual ~Internal(); 00054 00056 virtual Xapian::termcount get_approx_size() const = 0; 00057 00059 virtual void accumulate_stats(Xapian::Internal::ExpandStats & stats) const; 00060 00062 virtual std::string get_termname() const = 0; 00063 00065 virtual Xapian::termcount get_wdf() const = 0; 00066 00068 virtual Xapian::doccount get_termfreq() const = 0; 00069 00075 virtual Xapian::termcount get_collection_freq() const; 00076 00088 virtual Internal * next() = 0; 00089 00095 virtual Internal * skip_to(const std::string &term); 00096 00098 virtual bool at_end() const = 0; 00099 00101 virtual Xapian::termcount positionlist_count() const = 0; 00102 00104 virtual Xapian::PositionIterator positionlist_begin() const = 0; 00105 }; 00106 00107 // In the external API headers, this class is Xapian::TermIterator::Internal, 00108 // but in the library code it's still known as "TermList" in most places. 00109 typedef Xapian::TermIterator::Internal TermList; 00110 00111 #endif // XAPIAN_INCLUDED_TERMLIST_H