Akonadi Search

lib/resultiterator.cpp
1/*
2 * This file is part of the KDE Akonadi Search Project
3 * SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 *
7 */
8
9#include "resultiterator_p.h"
10
11using namespace Akonadi::Search::PIM;
12
13ResultIterator::ResultIterator()
14 : d(new ResultIteratorPrivate)
15{
16}
17
18ResultIterator::ResultIterator(const ResultIterator &ri)
19 : d(new ResultIteratorPrivate(*ri.d))
20{
21}
22
23ResultIterator::~ResultIterator() = default;
24
25bool ResultIterator::next()
26{
27 if (d->m_iter == d->m_end) {
28 return false;
29 }
30
31 if (d->m_firstElement) {
32 d->m_iter = d->m_mset.begin();
33 d->m_firstElement = false;
34 return d->m_iter != d->m_end;
35 }
36
37 ++d->m_iter;
38 return d->m_iter != d->m_end;
39}
40
41Akonadi::Item::Id ResultIterator::id()
42{
43 // qDebug() << d->m_iter.get_rank() << d->m_iter.get_weight();
44 return *(d->m_iter);
45}
PIM specific search API.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.