Messagelib

localdatabasefile.h
1 /*
2  SPDX-FileCopyrightText: 2016-2021 Laurent Montel <[email protected]>
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 
13 namespace WebEngineViewer
14 {
15 class LocalDataBaseFilePrivate;
16 struct Addition;
17 class WEBENGINEVIEWER_TESTS_EXPORT LocalDataBaseFile
18 {
19 public:
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  Q_REQUIRED_RESULT bool fileExists() const;
35 
36  bool reload();
37 
38  Q_REQUIRED_RESULT bool isValid() const;
39  Q_REQUIRED_RESULT quint16 getUint16(int offset) const;
40  Q_REQUIRED_RESULT quint32 getUint32(int offset) const;
41  Q_REQUIRED_RESULT quint64 getUint64(int offset) const;
42  const char *getCharStar(int offset) const;
43 
44  Q_REQUIRED_RESULT QByteArray searchHash(const QByteArray &hashToSearch);
45 
46  Q_REQUIRED_RESULT bool shouldCheck() const;
47  Q_REQUIRED_RESULT bool checkFileChanged();
48  Q_REQUIRED_RESULT QVector<WebEngineViewer::Addition> extractAllInfo() const;
49 
50 private:
51  std::unique_ptr<LocalDataBaseFilePrivate> const d;
52 };
53 }
54 
const QList< QKeySequence > & close()
const QList< QKeySequence > & reload()
bool isValid(QStringView ifopt)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 23:04:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.