xapian-core  2.0.0
documentvaluelist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2008,2009,2011,2017 Olly Betts
5  *
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.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
22 #define XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
23 
24 #include "backends/valuelist.h"
25 
27 
28 #include <map>
29 
31 class DocumentValueList final : public ValueList {
33  void operator=(const DocumentValueList &) = delete;
34 
37 
40 
45  std::map<Xapian::valueno, std::string>::const_iterator it;
46 
47  public:
49  : doc(doc_), it(doc->values->end()) { }
50 
51  Xapian::docid get_docid() const;
52 
53  std::string get_value() const;
54 
56 
57  bool at_end() const;
58 
59  void next();
60 
62  void skip_to(Xapian::docid slot);
63 
64  std::string get_description() const;
65 };
66 
67 #endif // XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
Iteration over values in a document.
Xapian::docid get_docid() const
Return the docid at the current position.
std::string get_description() const
Return a string description of this object.
DocumentValueList(const DocumentValueList &)=delete
Don't allow copying.
void operator=(const DocumentValueList &)=delete
Don't allow assignment.
void next()
Advance the current position to the next document in the value stream.
std::string get_value() const
Return the value at the current position.
void skip_to(Xapian::docid slot)
The parameter is actually a Xapian::valueno for this subclass.
bool at_end() const
Return true if the current position is past the last entry in this list.
std::map< Xapian::valueno, std::string >::const_iterator it
Iterator over the map inside doc.
DocumentValueList(const Xapian::Document::Internal *doc_)
Xapian::Internal::intrusive_ptr< const Xapian::Document::Internal > doc
Document internals we're iterating over.
Xapian::valueno get_valueno() const
Return the value slot for the current position/this iterator.
Abstract base class for a document.
Abstract base class for value streams.
Definition: valuelist.h:31
Abstract base class for a document.
unsigned valueno
The number for a value slot in a document.
Definition: types.h:90
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:51
Abstract base class for value streams.