1 /** @file contiguousalldocspostlist.cc
2 * @brief Iterate all document ids when they form a contiguous range.
4 /* Copyright (C) 2007,2008,2009 Olly Betts
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #include "contiguousalldocspostlist.h"
33 ContiguousAllDocsPostList::get_termfreq() const
39 ContiguousAllDocsPostList::get_docid() const
47 ContiguousAllDocsPostList::get_doclength() const
51 return db
->get_doclength(did
);
55 ContiguousAllDocsPostList::get_wdf() const
63 ContiguousAllDocsPostList::read_position_list()
65 // Throws the same exception.
66 return ContiguousAllDocsPostList::open_position_list();
70 ContiguousAllDocsPostList::open_position_list() const
72 throw Xapian::InvalidOperationError("Position lists not meaningful for ContiguousAllDocsPostList");
76 ContiguousAllDocsPostList::next(Xapian::weight
)
79 if (did
== doccount
) {
88 ContiguousAllDocsPostList::skip_to(Xapian::docid target
, Xapian::weight
)
92 if (target
> doccount
) {
102 ContiguousAllDocsPostList::at_end() const
104 return db
.get() == NULL
;
108 ContiguousAllDocsPostList::get_description() const
110 string
msg("ContiguousAllDocsPostList(1..");
111 msg
+= str(doccount
);