| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | #ifndef MANIFESTWRITER_H |
| 4 | #define MANIFESTWRITER_H |
| 5 | |
| 6 | #include <QtCore/qlist.h> |
| 7 | #include <QtCore/qset.h> |
| 8 | #include <QtCore/qstring.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | class ExampleNode; |
| 13 | class QDocDatabase; |
| 14 | class QXmlStreamWriter; |
| 15 | class ManifestWriter |
| 16 | { |
| 17 | struct ManifestMetaFilter |
| 18 | { |
| 19 | QSet<QString> m_names {}; |
| 20 | QSet<QString> m_attributes {}; |
| 21 | QSet<QString> m_tags {}; |
| 22 | }; |
| 23 | |
| 24 | public: |
| 25 | ManifestWriter(); |
| 26 | void generateManifestFiles(); |
| 27 | void generateExampleManifestFile(); |
| 28 | void readManifestMetaContent(); |
| 29 | QString retrieveExampleInstallationPath(const ExampleNode *example) const; |
| 30 | |
| 31 | private: |
| 32 | QString m_manifestDir {}; |
| 33 | QString m_examplesPath {}; |
| 34 | QString m_outputDirectory {}; |
| 35 | QString m_project {}; |
| 36 | QDocDatabase *m_qdb { nullptr }; |
| 37 | QList<ManifestMetaFilter> m_manifestMetaContent {}; |
| 38 | QStringList m_exampleCategories {}; |
| 39 | |
| 40 | template <typename F> |
| 41 | void processManifestMetaContent(const QString &fullName, F matchFunc); |
| 42 | }; |
| 43 | |
| 44 | QT_END_NAMESPACE |
| 45 | |
| 46 | #endif // MANIFESTWRITER_H |
| 47 | |