Baloo

mtimedb.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_MTIMEDB_H
9#define BALOO_MTIMEDB_H
10
11#include "engine_export.h"
12#include <lmdb.h>
13#include <QVector>
14#include <QMap>
15
16namespace Baloo {
17
18class PostingIterator;
19
20/**
21 * The MTime DB maps the file mtime to its id. This allows us to do
22 * fast searches of files between a certain time range.
23 */
24class BALOO_ENGINE_EXPORT MTimeDB
25{
26public:
27 explicit MTimeDB(MDB_dbi dbi, MDB_txn* txn);
28 ~MTimeDB();
29
30 static MDB_dbi create(MDB_txn* txn);
31 static MDB_dbi open(MDB_txn* txn);
32
33 void put(quint32 mtime, quint64 docId);
34 QVector<quint64> get(quint32 mtime);
35
36 void del(quint32 mtime, quint64 docId);
37
38 /**
39 * Get documents with an mtime between \p beginTime and
40 * \p endTime (inclusive)
41 */
42 PostingIterator* iterRange(quint32 beginTime, quint32 endTime);
43
44 QMap<quint32, quint64> toTestMap() const;
45private:
46 MDB_txn* m_txn;
47 MDB_dbi m_dbi;
48};
49}
50
51#endif // BALOO_MTIMEDB_H
The MTime DB maps the file mtime to its id.
Definition mtimedb.h:25
A PostingIterator is an abstract base class which can be used to iterate over all the "postings" or "...
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 Fri Nov 1 2024 18:46:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.