Branch data Line data Source code
1 : : /** @file documentvaluelist.h
2 : : * @brief Iteration over values in a document.
3 : : */
4 : : /* Copyright (C) 2007,2008,2009 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, write to the Free Software
18 : : * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 : : */
20 : :
21 : : #ifndef XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
22 : : #define XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
23 : :
24 : : #include "valuelist.h"
25 : :
26 : : #include "document.h"
27 : :
28 : : /// Iteration over values in a document.
29 [ + - ][ # # ]: 707875 : class DocumentValueList : public ValueList {
30 : : /// Don't allow assignment.
31 : : void operator=(const DocumentValueList &);
32 : :
33 : : /// Don't allow copying.
34 : : DocumentValueList(const DocumentValueList &);
35 : :
36 : : /// Document internals we're iterating over.
37 : : Xapian::Internal::RefCntPtr<const Xapian::Document::Internal> doc;
38 : :
39 : : /** Iterator over the map inside @a doc.
40 : : *
41 : : * If we haven't started yet, this will be set to: doc->values.end()
42 : : */
43 : : Xapian::Document::Internal::document_values::const_iterator it;
44 : :
45 : : public:
46 : 707875 : DocumentValueList(const Xapian::Internal::RefCntPtr<Xapian::Document::Internal> & doc_)
47 : 707875 : : doc(doc_), it(doc->values.end()) { }
48 : :
49 : : Xapian::docid get_docid() const;
50 : :
51 : : std::string get_value() const;
52 : :
53 : : Xapian::valueno get_valueno() const;
54 : :
55 : : bool at_end() const;
56 : :
57 : : void next();
58 : :
59 : : /// The parameter is actually a Xapian::valueno for this subclass.
60 : : void skip_to(Xapian::docid slot);
61 : :
62 : : std::string get_description() const;
63 : : };
64 : :
65 : : #endif // XAPIAN_INCLUDED_DOCUMENTVALUELIST_H
|