Baloo

documentdb.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_DOCUMENTDB_H
9#define BALOO_DOCUMENTDB_H
10
11#include "engine_export.h"
12#include <lmdb.h>
13#include <QVector>
14#include <QMap>
15
16namespace Baloo {
17
18/**
19 * Implements storage for a set of <term>s for the given docId
20 * Instantiated for:
21 * - document (content) terms
22 * - filename terms
23 * - xattr terms
24 */
25class BALOO_ENGINE_EXPORT DocumentDB
26{
27public:
28 DocumentDB(MDB_dbi dbi, MDB_txn* txn);
30
31 static MDB_dbi create(const char* name, MDB_txn* txn);
32 static MDB_dbi open(const char* name, MDB_txn* txn);
33
34 void put(quint64 docId, const QVector< QByteArray >& list);
35 QVector<QByteArray> get(quint64 docId);
36
37 bool contains(quint64 docId);
38 void del(quint64 docId);
39 uint size();
40
41 QMap<quint64, QVector<QByteArray>> toTestMap() const;
42private:
43 MDB_txn* m_txn;
44 MDB_dbi m_dbi;
45};
46}
47
48#endif // BALOO_DOCUMENTDB_H
Implements storage for a set of s for the given docId Instantiated for:
Definition documentdb.h:26
Implements storage for docIds without any associated data Instantiated for:
Definition coding.cpp:11
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.