[ci] Fix clang-santisers job for GHA change
[xapian.git] / xapian-core / api / vectortermlist.cc
bloba27d8f354fc3131265074fe2e00503847693415a
1 /** @file
2 * @brief A vector-like container of terms which can be iterated.
3 */
4 /* Copyright (C) 2011,2015,2024 Olly Betts
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (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
21 #include <config.h>
23 #include "vectortermlist.h"
25 #include "omassert.h"
26 #include "pack.h"
27 #include "xapian/error.h"
29 using namespace std;
31 Xapian::termcount
32 VectorTermList::get_approx_size() const
34 return num_terms;
37 Xapian::termcount
38 VectorTermList::get_wdf() const
40 // Check we've started but not reached the end.
41 Assert(p != data.data());
42 Assert(p != NULL);
43 return 1;
46 Xapian::doccount
47 VectorTermList::get_termfreq() const
49 throw Xapian::InvalidOperationError("VectorTermList::get_termfreq() not meaningful");
52 TermList *
53 VectorTermList::next()
55 // Check we've not reached the end.
56 Assert(p != NULL);
58 const char * end = data.data() + data.size();
59 if (p == end) {
60 return this;
62 if (!unpack_string(&p, end, current_term)) {
63 unpack_throw_serialisation_error(p);
66 return NULL;
69 TermList*
70 VectorTermList::skip_to(string_view)
72 // skip_to only makes sense for termlists which are in sorted order.
73 throw Xapian::InvalidOperationError("VectorTermList::skip_to() not meaningful");
76 Xapian::termcount
77 VectorTermList::positionlist_count() const
79 throw Xapian::InvalidOperationError("VectorTermList::positionlist_count() not meaningful");
82 PositionList*
83 VectorTermList::positionlist_begin() const
85 throw Xapian::InvalidOperationError("VectorTermList::positionlist_begin() not meaningful");