xapian-core
1.4.26
include
xapian
iterator.h
Go to the documentation of this file.
1
4
/* Copyright (C) 2014,2016,2017,2019 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
19
* USA
20
*/
21
22
#ifndef XAPIAN_INCLUDED_ITERATOR_H
23
#define XAPIAN_INCLUDED_ITERATOR_H
24
25
/* These functions are not intended to be used from user C++ code - they are
26
* provided to make implementing language-idiomatic wrappers around Xapian's
27
* iterator classes easier in bindings for other languages.
28
*
29
* If you make use of this API, please let us know on xapian-devel so we can
30
* coordinate any incompatible changes which might be required in the future.
31
*
32
* Currently known users:
33
*
34
* * xapian-bindings:
35
* + Java
36
* + PHP
37
* * xapian-core:
38
* + examples/xapian-pos.cc
39
* * xapian-glib
40
*/
41
42
#include <
xapian.h
>
43
44
namespace
Xapian
{
45
47
inline
bool
iterator_valid
(
const
Xapian::ESetIterator
& it) {
48
return
it.
off_from_end
!= 0;
49
}
50
52
inline
bool
iterator_valid
(
const
Xapian::MSetIterator
& it) {
53
return
it.
off_from_end
!= 0;
54
}
55
57
inline
void
iterator_rewind
(
Xapian::ESetIterator
& it) {
58
it.
off_from_end
= it.
eset
.
size
();
59
}
60
62
inline
void
iterator_rewind
(
Xapian::MSetIterator
& it) {
63
it.
off_from_end
= it.
mset
.
size
();
64
}
65
67
inline
bool
iterator_rewound
(
Xapian::ESetIterator
& it) {
68
return
it.
off_from_end
== it.
eset
.
size
();
69
}
70
72
inline
bool
iterator_rewound
(
Xapian::MSetIterator
& it) {
73
return
it.
off_from_end
== it.
mset
.
size
();
74
}
75
77
inline
bool
iterator_valid
(
const
Xapian::PositionIterator
& it) {
78
return
it.
internal
!= NULL;
79
}
80
82
inline
bool
iterator_valid
(
const
Xapian::PostingIterator
& it) {
83
return
it.
internal
!= NULL;
84
}
85
87
inline
bool
iterator_valid
(
const
Xapian::TermIterator
& it) {
88
return
it.
internal
!= NULL;
89
}
90
92
inline
bool
iterator_valid
(
const
Xapian::ValueIterator
& it) {
93
return
it.
internal
!= NULL;
94
}
95
97
inline
bool
iterator_valid
(
const
Xapian::Utf8Iterator
& it) {
98
return
it !=
Xapian::Utf8Iterator
();
99
}
100
101
}
102
103
#endif // XAPIAN_INCLUDED_ITERATOR_H
Xapian
The Xapian namespace contains public interfaces for the Xapian library.
Definition:
compactor.cc:80
Xapian::PostingIterator::internal
Internal * internal
Definition:
postingiterator.h:44
Xapian::MSet::size
Xapian::doccount size() const
Return number of items in this MSet object.
Definition:
omenquire.cc:318
Xapian::ValueIterator::internal
Internal * internal
Definition:
valueiterator.h:45
Xapian::ValueIterator
Class for iterating over document values.
Definition:
valueiterator.h:40
Xapian::MSetIterator::mset
Xapian::MSet mset
Definition:
mset.h:376
Xapian::PositionIterator::internal
Internal * internal
Definition:
positioniterator.h:45
Xapian::TermIterator
Class for iterating over a list of terms.
Definition:
termiterator.h:41
Xapian::PostingIterator
Class for iterating over a list of terms.
Definition:
postingiterator.h:41
Xapian::ESet::size
Xapian::doccount size() const
Return number of items in this ESet object.
Definition:
esetinternal.cc:247
Xapian::MSetIterator
Iterator over a Xapian::MSet.
Definition:
mset.h:368
xapian.h
Public interfaces for the Xapian library.
Xapian::iterator_valid
bool iterator_valid(const Xapian::ESetIterator &it)
Definition:
iterator.h:47
Xapian::ESetIterator::eset
Xapian::ESet eset
Definition:
eset.h:168
Xapian::PositionIterator
Class for iterating over term positions.
Definition:
positioniterator.h:40
Xapian::ESetIterator
Iterator over a Xapian::ESet.
Definition:
eset.h:160
Xapian::Utf8Iterator
An iterator which returns Unicode character values from a UTF-8 encoded string.
Definition:
unicode.h:38
Xapian::TermIterator::internal
Internal * internal
Definition:
termiterator.h:44
Xapian::MSetIterator::off_from_end
Xapian::MSet::size_type off_from_end
Definition:
mset.h:383
Xapian::ESetIterator::off_from_end
Xapian::ESet::size_type off_from_end
Definition:
eset.h:175
Xapian::iterator_rewind
void iterator_rewind(Xapian::ESetIterator &it)
Definition:
iterator.h:57
Xapian::iterator_rewound
bool iterator_rewound(Xapian::ESetIterator &it)
Definition:
iterator.h:67
Generated by
Doxygen 1.8.13