Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
@@ -11,12 +11,11 @@
|
||||
#include <grantlee/engine.h>
|
||||
|
||||
using namespace CodeGen;
|
||||
GeneratorGrantleeBase::GeneratorGrantleeBase(const char *loggerName)
|
||||
: m_engine(new Grantlee::Engine)
|
||||
GeneratorGrantleeBase::GeneratorGrantleeBase(const char *loggerName) : m_engine(new Grantlee::Engine)
|
||||
, m_ctx(new Grantlee::Context)
|
||||
, m_structBuilder(nullptr)
|
||||
.getNGLLogger(loggerName))
|
||||
{
|
||||
.getNGLLogger(loggerName)),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
|
||||
GeneratorGrantleeBase::~GeneratorGrantleeBase()
|
||||
@@ -48,7 +47,7 @@ bool GeneratorGrantleeBase::setTemplate(const QString &templateName, const QStri
|
||||
m_template = m_engine->newTemplate(tmpl, QStringLiteral("myTemplate"));
|
||||
if (m_template->error())
|
||||
{
|
||||
WARNING_LOG() << "Error parsing template '" << templateName
|
||||
WARNING_LOG(m_logger) << "Error parsing template '" << templateName
|
||||
<< "': " << m_template->errorString();
|
||||
return false;
|
||||
}
|
||||
@@ -88,7 +87,7 @@ bool GeneratorGrantleeBase::generateData(const QString &templateName,
|
||||
QFile f(outDirectory + QLatin1Char('/') + outFilename);
|
||||
if (!f.open(QIODevice::WriteOnly))
|
||||
{
|
||||
ERROR_LOG() << "Error opening file '" << f.fileName() << "' for writing: "
|
||||
ERROR_LOG(m_logger) << "Error opening file '" << f.fileName() << "' for writing: "
|
||||
<< f.errorString() << "(" << f.error() << ")";
|
||||
return false;
|
||||
}
|
||||
@@ -96,7 +95,7 @@ bool GeneratorGrantleeBase::generateData(const QString &templateName,
|
||||
f.write(outData);
|
||||
f.close();
|
||||
|
||||
DEBUG_LOG() << "Written data to " << f.fileName();
|
||||
DEBUG_LOG(m_logger) << "Written data to " << f.fileName();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -105,7 +104,7 @@ bool GeneratorGrantleeBase::readFile(const QString &filename, QString &data) con
|
||||
QFile f(filename);
|
||||
if (!f.open(QIODevice::ReadOnly))
|
||||
{
|
||||
ERROR_LOG() << "Error opening file " << filename
|
||||
ERROR_LOG(m_logger) << "Error opening file " << filename
|
||||
<< " - error: " << f.errorString();
|
||||
return false;
|
||||
}
|
||||
@@ -121,7 +120,7 @@ bool GeneratorGrantleeBase::getFilenameFromData(const QString &dataToParse, QStr
|
||||
int idx = dataToParse.indexOf(filenameMarker);
|
||||
if (idx < 0)
|
||||
{
|
||||
ERROR_LOG() << "Could not find marker '" << filenameMarker
|
||||
ERROR_LOG(m_logger) << "Could not find marker '" << filenameMarker
|
||||
<< "' in data!";
|
||||
return false;
|
||||
}
|
||||
@@ -129,7 +128,7 @@ bool GeneratorGrantleeBase::getFilenameFromData(const QString &dataToParse, QStr
|
||||
int endIdx = dataToParse.indexOf(QLatin1Char('\n'), idx);
|
||||
if (endIdx < 0)
|
||||
{
|
||||
ERROR_LOG() << "Could not find end marker '\\n' in data!";
|
||||
ERROR_LOG(m_logger) << "Could not find end marker '\\n' in data!";
|
||||
return false;
|
||||
}
|
||||
filename = dataToParse.mid(idx, endIdx - idx).trimmed();
|
||||
@@ -160,12 +159,12 @@ void GeneratorGrantleeBase::addCustomFunctions(const QVector<CustomServiceFuncti
|
||||
break;
|
||||
case CustomServiceFunctionInformation::Type::DbNotify:
|
||||
|
||||
WARNING_LOG() << "Internal error - Trying to handle DbNotify in addCustomFunctions(): "
|
||||
WARNING_LOG(m_logger) << "Internal error - Trying to handle DbNotify in addCustomFunctions(): "
|
||||
<< csfi.methodName;
|
||||
delete customFunctionWrapper;
|
||||
break;
|
||||
}
|
||||
DEBUG_LOG() << "Added custom db function " << csfi.methodName;
|
||||
DEBUG_LOG(m_logger) << "Added custom db function " << csfi.methodName;
|
||||
}
|
||||
m_ctx->insert(QStringLiteral("custom_dtc_procs"), vlCustomDtcFunctions);
|
||||
m_ctx->insert(QStringLiteral("custom_db_procs"), vlCustomDbFunctions);
|
||||
@@ -185,17 +184,17 @@ void GeneratorGrantleeBase::exportUsedServices(const XmlReader *reader)
|
||||
const int idx = fullPath.lastIndexOf(QLatin1Char('.'));
|
||||
if (idx < 0)
|
||||
{
|
||||
ERROR_LOG() << "Could not parse file path: " << fullPath;
|
||||
ERROR_LOG(m_logger) << "Could not parse file path: " << fullPath;
|
||||
continue;
|
||||
}
|
||||
const QString idlFile = fullPath.left(idx);
|
||||
if (idlFile.isEmpty())
|
||||
{
|
||||
WARNING_LOG() << "Could not find idl file for service " << svc;
|
||||
WARNING_LOG(m_logger) << "Could not find idl file for service " << svc;
|
||||
continue;
|
||||
}
|
||||
idlServicesWrapper->addService(svc, idlFile);
|
||||
DEBUG_LOG() << "Added service " << svc;
|
||||
DEBUG_LOG(m_logger) << "Added service " << svc;
|
||||
}
|
||||
m_ctx->insert(QStringLiteral("ext_services"), idlServicesWrapper);
|
||||
}
|
||||
Reference in new issue
Block a user