Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.h
T
torstenandCopilot d6b6ffce7c Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files)
- Formatted LtsAppDescriptor module files
- Formatted LtsAppManager/AppChooser files
- Applied clang-format to all DTC and enum headers across modules
- Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/)

Cosmetic changes only, no functional modifications.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-19 14:46:29 +02:00

56 lines
1.4 KiB
C++

#pragma once
#include "XmlReader.h"
#include <QObject>
#include <QSharedPointer>
namespace NGL
{
class INGLLogger;
}
namespace Grantlee
{
class Context;
class Engine;
class TemplateImpl;
using Template = QSharedPointer<TemplateImpl>;
} // namespace Grantlee
namespace CodeGen
{
class StructBuilder;
class GeneratorGrantleeBase : public QObject
{
Q_OBJECT
public:
virtual ~GeneratorGrantleeBase();
virtual bool init(const XmlReader* reader, StructBuilder* structBuilder) = 0;
bool setTemplate(const QString& templateName, const QString& tmpl);
QString render() const;
QString errorString() const;
bool generateData(const QString& templateName, const QString& outDirectory);
protected:
NGL::INGLLogger& m_logger;
explicit GeneratorGrantleeBase(const char* loggerName);
bool initInternal(const XmlReader* reader, StructBuilder* structBuilder);
bool readFile(const QString& filename, QString& data) const;
bool getFilenameFromData(const QString& dataToParse, QString& filename) const;
void addCustomFunctions(const QVector<CustomServiceFunctionInformation>& customFunctions);
void exportUsedServices(const XmlReader* reader);
protected:
NGL::INGLLogger& m_logger;
Grantlee::Engine* m_engine;
Grantlee::Context* m_ctx;
Grantlee::Template m_template;
StructBuilder* m_structBuilder;
};
} // namespace CodeGen