#pragma once #include #include #include #include #include #include "logcat.hpp" QS_DECLARE_LOGGING_CATEGORY(logQmlScanner); // expects canonical paths class QmlScanner { public: QmlScanner() = default; QmlScanner(const QDir& rootPath): rootPath(rootPath) {} // path must be canonical void scanDir(const QString& path); void scanQmlRoot(const QString& path); QVector scannedDirs; QVector scannedFiles; QHash fileIntercepts; private: QDir rootPath; bool scanQmlFile(const QString& path, bool& singleton, bool& internal); bool scanQmlJson(const QString& path); [[nodiscard]] static QPair jsonToQml(const QJsonValue& value, int indent = 0); };