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
15namespace Scanner {
16
17enum class InputFormat {
18 QtAttributions = 0x1, // qt_attributions.json
19 ChromiumAttributions = 0x2, // README.chromium
20};
21Q_DECLARE_FLAGS(InputFormats, InputFormat)
22Q_DECLARE_OPERATORS_FOR_FLAGS(InputFormats)
23
24enum class Check { Paths = 0x1, All = Paths };
25Q_DECLARE_FLAGS(Checks, Check)
26Q_DECLARE_OPERATORS_FOR_FLAGS(Checks)
27
28std::optional<QList<Package>> readFile(const QString &filePath, Checks checks, LogLevel logLevel);
29std::optional<QList<Package>> scanDirectory(const QString &directory, InputFormats inputFormats,
30 Checks checks, LogLevel logLevel);
31}
32
33#endif // SCANNER_H
34

source code of qttools/src/qtattributionsscanner/scanner.h