Messagelib

localdatabasefile.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "webengineviewer_private_export.h"
10#include <QString>
11#include <memory>
12
13namespace WebEngineViewer
14{
15class LocalDataBaseFilePrivate;
16struct Addition;
17class WEBENGINEVIEWER_TESTS_EXPORT LocalDataBaseFile
18{
19public:
20 /*
21 * binary file:
22 * index 0 => quint16 => major version
23 * index 2 => quint16 => minor version
24 * index 4 => quint64 => number of element
25 *
26 * After : index of item in binary file
27 *
28 * value
29 */
30 explicit LocalDataBaseFile(const QString &filename);
31 ~LocalDataBaseFile();
32
33 void close();
34 [[nodiscard]] bool fileExists() const;
35
36 [[nodiscard]] bool reload();
37
38 [[nodiscard]] bool isValid() const;
39 [[nodiscard]] quint16 getUint16(int offset) const;
40 [[nodiscard]] quint32 getUint32(int offset) const;
41 [[nodiscard]] quint64 getUint64(int offset) const;
42 [[nodiscard]] const char *getCharStar(int offset) const;
43
44 [[nodiscard]] QByteArray searchHash(const QByteArray &hashToSearch);
45
46 [[nodiscard]] bool shouldCheck() const;
47 [[nodiscard]] bool checkFileChanged();
48 [[nodiscard]] QList<WebEngineViewer::Addition> extractAllInfo() const;
49
50private:
51 std::unique_ptr<LocalDataBaseFilePrivate> const d;
52};
53}
bool fileExists(const QUrl &path)
bool isValid(QStringView ifopt)
const QList< QKeySequence > & close()
const QList< QKeySequence > & reload()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.