Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/DaoGeneratorGrantlee.cpp
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

55 lines
1.9 KiB
C++

#include "DaoGeneratorGrantlee.h"
#include "StructBuilder.h"
#include <NGLLogger/INGLLogger.h>
#include <grantlee/context.h>
using namespace CodeGen;
DaoGeneratorGrantlee::DaoGeneratorGrantlee() : GeneratorGrantleeBase("CodeGen.DaoGeneratorGrantlee") {}
bool DaoGeneratorGrantlee::init(const XmlReader* reader, StructBuilder* structBuilder)
{
if (!GeneratorGrantleeBase::initInternal(reader, structBuilder))
return false;
if (reader->isServiceExerciseIndependent())
m_ctx->insert(QStringLiteral("isExerciseIndependent"), QLatin1String("1"));
bool bHasDbNotifications = false;
QVector<DbStructWrapper*> vlServiceStructs;
QVector<DbStructWrapper*> vlStaticDataStructs;
const QVector<CompleteStructInformation> csiData = structBuilder->structInformations();
vlServiceStructs.reserve(csiData.size());
vlStaticDataStructs.reserve(csiData.size());
for (const CompleteStructInformation& csi : csiData)
{
DbStructWrapper* dbStructWrapper(new DbStructWrapper(csi, this));
if (csi.hasStaticContent)
vlStaticDataStructs += dbStructWrapper;
else
vlServiceStructs += dbStructWrapper;
if (!csi.dbNotifications.isEmpty())
bHasDbNotifications = true;
}
if (structBuilder->needPoint3d())
m_ctx->insert(QStringLiteral("need_point3d"), QLatin1String("1"));
if (structBuilder->needPgArrayInclude())
m_ctx->insert(QStringLiteral("need_pgarray"), QLatin1String("1"));
m_ctx->insert(QStringLiteral("cpp_structs"), QVariant::fromValue(vlServiceStructs));
m_ctx->insert(QStringLiteral("data_structs"), QVariant::fromValue(vlStaticDataStructs));
if (bHasDbNotifications)
m_ctx->insert(QStringLiteral("has_db_notifications"), QLatin1String("1"));
m_ctx->insert(QStringLiteral("library_target"), QStringLiteral("COMMON"));
exportUsedServices(reader);
return true;
}