Baloo

idfilenamedb.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_IDFILENAMEDB_H
9#define BALOO_IDFILENAMEDB_H
10
11#include "engine_export.h"
12#include <lmdb.h>
13#include <QByteArray>
14#include <QMap>
15
16namespace Baloo {
17
18class BALOO_ENGINE_EXPORT IdFilenameDB
19{
20public:
21 IdFilenameDB(MDB_dbi dbi, MDB_txn* txn);
22 ~IdFilenameDB();
23
24 static MDB_dbi create(MDB_txn* txn);
25 static MDB_dbi open(MDB_txn* txn);
26
27 struct FilePath {
28 quint64 parentId = 0;
30
31 bool operator == (const FilePath& fp) const {
32 return parentId == fp.parentId && name == fp.name;
33 }
34 };
35 void put(quint64 docId, const FilePath& path);
36 FilePath get(quint64 docId);
37 bool get(quint64 docId, FilePath& path);
38 bool contains(quint64 docId);
39 void del(quint64 docId);
40
41 QMap<quint64, FilePath> toTestMap() const;
42private:
43 MDB_txn* m_txn;
44 MDB_dbi m_dbi;
45};
46
47}
48
49#endif // BALOO_IDFILENAMEDB_H
Implements storage for docIds without any associated data Instantiated for:
Definition coding.cpp:11
KIOCORE_EXPORT DeleteJob * del(const QList< QUrl > &src, JobFlags flags=DefaultFlags)
KIOCORE_EXPORT TransferJob * get(const QUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
KIOCORE_EXPORT TransferJob * put(const QUrl &url, int permissions, JobFlags flags=DefaultFlags)
QString name(StandardAction id)
QAction * create(StandardAction id, const Receiver *recvr, Func slot, QObject *parent, std::optional< Qt::ConnectionType > connectionType=std::nullopt)
const QList< QKeySequence > & open()
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.