Baloo

documentiddb.h
1/*
2 This file is part of the KDE Baloo project.
3 SPDX-FileCopyrightText: 2015 Vishesh Handa <vhanda@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef BALOO_DOCUMENTIDDB_H
9#define BALOO_DOCUMENTIDDB_H
10
11#include "engine_export.h"
12#include <QVector>
13#include <lmdb.h>
14
15/**
16 * Implements storage for docIds without any associated data
17 * Instantiated for:
18 * - content indexing (files to be reindexed)
19 * - failed ids (files no indexable, e.g. due to crashing indexers)
20 */
21namespace Baloo {
22
23class BALOO_ENGINE_EXPORT DocumentIdDB
24{
25public:
26 DocumentIdDB(MDB_dbi dbi, MDB_txn* txn);
27 ~DocumentIdDB();
28
29 static MDB_dbi create(const char* name, MDB_txn* txn);
30 static MDB_dbi open(const char* name, MDB_txn* txn);
31
32 void put(quint64 docId);
33 bool contains(quint64 docId);
34 void del(quint64 docID);
35
36 QVector<quint64> fetchItems(int size);
37 uint size();
38
39 QVector<quint64> toTestVector() const;
40private:
41 MDB_txn* m_txn;
42 MDB_dbi m_dbi;
43};
44
45}
46
47#endif // BALOO_DOCUMENTIDDB_H
Implements storage for docIds without any associated data Instantiated for:
Definition coding.cpp:11
QAction * create(GameStandardAction id, const QObject *recvr, const char *slot, QObject *parent)
KIOCORE_EXPORT DeleteJob * del(const QList< QUrl > &src, JobFlags flags=DefaultFlags)
KIOCORE_EXPORT TransferJob * put(const QUrl &url, int permissions, JobFlags flags=DefaultFlags)
const QList< QKeySequence > & open()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.