Baloo

positioninfo.h
1 /*
2  SPDX-FileCopyrightText: 2015 Vishesh Handa <[email protected]>
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 
13 namespace Baloo {
14 
15 class PositionInfo {
16 public:
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 
35 inline 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 
44 Q_DECLARE_TYPEINFO(Baloo::PositionInfo, Q_MOVABLE_TYPE);
45 
46 #endif // BALOO_POSITIONINFO_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
QDebug & nospace()
QTextStream & hex(QTextStream &stream)
Implements storage for docIds without any associated data Instantiated for:
Definition: coding.cpp:11
QTextStream & dec(QTextStream &stream)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Nov 29 2023 03:56:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.