1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef SCANNER_H |
5 | #define SCANNER_H |
6 | |
7 | #include "logging.h" |
8 | #include "package.h" |
9 | |
10 | #include <QtCore/qstring.h> |
11 | #include <QtCore/qlist.h> |
12 | |
13 | #include <optional> |
14 | |
15 | namespace Scanner { |
16 | |
17 | enum class InputFormat { |
18 | QtAttributions = 0x1, // qt_attributions.json |
19 | ChromiumAttributions = 0x2, // README.chromium |
20 | }; |
21 | Q_DECLARE_FLAGS(InputFormats, InputFormat) |
22 | Q_DECLARE_OPERATORS_FOR_FLAGS(InputFormats) |
23 | |
24 | enum class Check { Paths = 0x1, All = Paths }; |
25 | Q_DECLARE_FLAGS(Checks, Check) |
26 | Q_DECLARE_OPERATORS_FOR_FLAGS(Checks) |
27 | |
28 | std::optional<QList<Package>> readFile(const QString &filePath, Checks checks, LogLevel logLevel); |
29 | std::optional<QList<Package>> scanDirectory(const QString &directory, InputFormats inputFormats, |
30 | Checks checks, LogLevel logLevel); |
31 | } |
32 | |
33 | #endif // SCANNER_H |
34 | |