Baloo

databasesanitizer.h
1/*
2 This file is part of the KDE Baloo project.
3 SPDX-FileCopyrightText: 2018 Michael Heidelbach <ottwolt@gmail.com>
4
5 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
6*/
7
8#ifndef BALOODATABASESANITIZER_H
9#define BALOODATABASESANITIZER_H
10
11#include "transaction.h"
12
13namespace Baloo
14{
15class DatabaseSanitizerImpl;
16/**
17* \brief Provide methods to show database problems and
18* sanitize them.
19*/
21{
22public:
23 enum ItemAccessFilterFlags {
24 IgnoreNone = 0,
25 IgnoreAvailable = 1,
26 IgnoreUnavailable = 2,
27 IgnoreMounted = 8,
28 IgnoreUnmounted = 0x10,
29 };
30 Q_DECLARE_FLAGS(ItemAccessFilters, ItemAccessFilterFlags)
31
32public:
33 DatabaseSanitizer(const Database& db, Transaction::TransactionType type);
34 DatabaseSanitizer(Database* db, Transaction::TransactionType type);
36
37 /**
38 * Print database content to stdout
39 *
40 * \p deviceIDs filter by device ids. Negative numbers list everything but...
41 * with empty \p deviceIDs(default) everything is printed.
42 *
43 * \p missingOnly Simulate purging operation. Only inaccessible items are printed.
44 *
45 * \p urlFilter Filter result urls. Default is null = Print everything.
46 */
47 void printList(const QVector<qint64>& deviceIds,
48 const ItemAccessFilters accessFilter = IgnoreNone,
50 );
51 /**
52 * Print info about known devices to stdout
53 *
54 * \p deviceIDs filter by device ids. Negative numbers list everything but...
55 * with empty \p deviceIDs(default) everything is printed.
56 *
57 * \p accessFilter filter by accessibility. E.g IgnoreAvailable|IgnoreUnmounted
58 * prints only mounted devices with inaccessible files.
59 */
60 void printDevices(const QVector<qint64>& deviceIds, const ItemAccessFilters accessFilter = IgnoreNone);
61
62 void removeStaleEntries(const QVector<qint64>& deviceIds,
63 const DatabaseSanitizer::ItemAccessFilters accessFilter = DatabaseSanitizer::IgnoreNone,
64 const bool dryRun = false,
66 );
67
68private:
70 DatabaseSanitizerImpl* m_pimpl;
71};
72
73Q_DECLARE_OPERATORS_FOR_FLAGS(DatabaseSanitizer::ItemAccessFilters)
74
75}
76#endif // BALOODATABASESANITIZER_H
Provide methods to show database problems and sanitize them.
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 Jun 7 2024 11:55:53 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.