Baloo

positioninfo.h
1/*
2 SPDX-FileCopyrightText: 2015 Vishesh Handa <vhanda@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef BALOO_POSITIONINFO_H
8#define BALOO_POSITIONINFO_H
9
10#include <QVector>
11#include <QDebug>
12
13namespace Baloo {
14
15class PositionInfo {
16public:
17 quint64 docId;
18 QVector<uint> positions;
19
20 PositionInfo(quint64 id = 0, const QVector<uint> posList = QVector<uint>())
21 : docId(id), positions(posList) {}
22
23 bool operator ==(const PositionInfo& rhs) const {
24 return docId == rhs.docId;
25 }
26 bool operator !=(const PositionInfo& rhs) const {
27 return docId != rhs.docId;
28 }
29
30 bool operator <(const PositionInfo& rhs) const {
31 return docId < rhs.docId;
32 }
33};
34
35inline QDebug operator<<(QDebug dbg, const PositionInfo &pos) {
36 QDebugStateSaver saver(dbg);
37 dbg.nospace() << Qt::hex << "(" << pos.docId << ": "
38 << Qt::dec << pos.positions << ")";
39 return dbg;
40}
41
42}
43
44Q_DECLARE_TYPEINFO(Baloo::PositionInfo, Q_RELOCATABLE_TYPE);
45
46#endif // BALOO_POSITIONINFO_H
Implements storage for docIds without any associated data Instantiated for:
Definition coding.cpp:11
QDebug operator<<(QDebug dbg, const DcrawInfoContainer &c)
QDebug & nospace()
QTextStream & dec(QTextStream &stream)
QTextStream & hex(QTextStream &stream)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.