|
@@ -46,7 +46,7 @@ MessageDeclarationPrinter::MessageDeclarationPrinter(const Descriptor *message,
|
|
void MessageDeclarationPrinter::printClassForwardDeclarationPrivate()
|
|
void MessageDeclarationPrinter::printClassForwardDeclarationPrivate()
|
|
{
|
|
{
|
|
if (common::hasNestedMessages(mDescriptor)) {
|
|
if (common::hasNestedMessages(mDescriptor)) {
|
|
- mPrinter->Print({{"namespace", mName + Templates::QtProtobufNestedNamespace}}, Templates::NamespaceTemplate);
|
|
|
|
|
|
+ mPrinter->Print({{"namespace", mTypeMap["classname"] + Templates::QtProtobufNestedNamespace}}, Templates::NamespaceTemplate);
|
|
common::iterateNestedMessages(mDescriptor, [this](const ::google::protobuf::Descriptor *nestedMessage) {
|
|
common::iterateNestedMessages(mDescriptor, [this](const ::google::protobuf::Descriptor *nestedMessage) {
|
|
MessageDeclarationPrinter nesterPrinter(nestedMessage, mPrinter);
|
|
MessageDeclarationPrinter nesterPrinter(nestedMessage, mPrinter);
|
|
nesterPrinter.printClassForwardDeclarationPrivate();
|
|
nesterPrinter.printClassForwardDeclarationPrivate();
|
|
@@ -54,8 +54,8 @@ void MessageDeclarationPrinter::printClassForwardDeclarationPrivate()
|
|
mPrinter->Print(Templates::SimpleBlockEnclosureTemplate);
|
|
mPrinter->Print(Templates::SimpleBlockEnclosureTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ProtoClassForwardDeclarationTemplate);
|
|
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ComplexListTypeUsingTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ProtoClassForwardDeclarationTemplate);
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ComplexListTypeUsingTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printClassForwardDeclaration()
|
|
void MessageDeclarationPrinter::printClassForwardDeclaration()
|
|
@@ -75,7 +75,7 @@ void MessageDeclarationPrinter::printClassDeclaration()
|
|
|
|
|
|
void MessageDeclarationPrinter::printClassDeclarationPrivate()
|
|
void MessageDeclarationPrinter::printClassDeclarationPrivate()
|
|
{
|
|
{
|
|
- mPrinter->Print({{"namespace", mName + Templates::QtProtobufNestedNamespace}}, Templates::NamespaceTemplate);
|
|
|
|
|
|
+ mPrinter->Print({{"namespace", mTypeMap["classname"] + Templates::QtProtobufNestedNamespace}}, Templates::NamespaceTemplate);
|
|
common::iterateNestedMessages(mDescriptor, [this](const ::google::protobuf::Descriptor *nestedMessage) {
|
|
common::iterateNestedMessages(mDescriptor, [this](const ::google::protobuf::Descriptor *nestedMessage) {
|
|
MessageDeclarationPrinter nesterPrinter(nestedMessage, mPrinter);
|
|
MessageDeclarationPrinter nesterPrinter(nestedMessage, mPrinter);
|
|
nesterPrinter.printClassDeclarationPrivate();
|
|
nesterPrinter.printClassDeclarationPrivate();
|
|
@@ -92,29 +92,29 @@ void MessageDeclarationPrinter::printClassDeclarationPrivate()
|
|
void MessageDeclarationPrinter::printCopyFunctionality()
|
|
void MessageDeclarationPrinter::printCopyFunctionality()
|
|
{
|
|
{
|
|
assert(mDescriptor != nullptr);
|
|
assert(mDescriptor != nullptr);
|
|
- mPrinter->Print({{"classname", mName}},
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap,
|
|
Templates::CopyConstructorDeclarationTemplate);
|
|
Templates::CopyConstructorDeclarationTemplate);
|
|
|
|
|
|
- mPrinter->Print({{"classname", mName}},
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap,
|
|
Templates::AssignmentOperatorDeclarationTemplate);
|
|
Templates::AssignmentOperatorDeclarationTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printMoveSemantic()
|
|
void MessageDeclarationPrinter::printMoveSemantic()
|
|
{
|
|
{
|
|
assert(mDescriptor != nullptr);
|
|
assert(mDescriptor != nullptr);
|
|
- mPrinter->Print({{"classname", mName}},
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap,
|
|
Templates::MoveConstructorDeclarationTemplate);
|
|
Templates::MoveConstructorDeclarationTemplate);
|
|
|
|
|
|
- mPrinter->Print({{"classname", mName}},
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap,
|
|
Templates::MoveAssignmentOperatorDeclarationTemplate);
|
|
Templates::MoveAssignmentOperatorDeclarationTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printComparisonOperators()
|
|
void MessageDeclarationPrinter::printComparisonOperators()
|
|
{
|
|
{
|
|
assert(mDescriptor != nullptr);
|
|
assert(mDescriptor != nullptr);
|
|
- mPrinter->Print({{"classname", mName}}, Templates::EqualOperatorDeclarationTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::EqualOperatorDeclarationTemplate);
|
|
|
|
|
|
- mPrinter->Print({{"classname", mName}}, Templates::NotEqualOperatorDeclarationTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::NotEqualOperatorDeclarationTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printConstructors()
|
|
void MessageDeclarationPrinter::printConstructors()
|
|
@@ -132,7 +132,7 @@ void MessageDeclarationPrinter::printConstructors()
|
|
void MessageDeclarationPrinter::printConstructor(int fieldCount)
|
|
void MessageDeclarationPrinter::printConstructor(int fieldCount)
|
|
{
|
|
{
|
|
std::vector<std::string> parameterList;
|
|
std::vector<std::string> parameterList;
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ProtoConstructorBeginTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ProtoConstructorBeginTemplate);
|
|
for (int i = 0; i < fieldCount; i++) {
|
|
for (int i = 0; i < fieldCount; i++) {
|
|
const FieldDescriptor *field = mDescriptor->field(i);
|
|
const FieldDescriptor *field = mDescriptor->field(i);
|
|
const char *parameterTemplate = Templates::ConstructorParameterTemplate;
|
|
const char *parameterTemplate = Templates::ConstructorParameterTemplate;
|
|
@@ -148,7 +148,7 @@ void MessageDeclarationPrinter::printConstructor(int fieldCount)
|
|
mPrinter->Print(common::producePropertyMap(field, mDescriptor), parameterTemplate);
|
|
mPrinter->Print(common::producePropertyMap(field, mDescriptor), parameterTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ProtoConstructorEndTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ProtoConstructorEndTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printMaps()
|
|
void MessageDeclarationPrinter::printMaps()
|
|
@@ -176,7 +176,7 @@ void MessageDeclarationPrinter::printNested()
|
|
|
|
|
|
void MessageDeclarationPrinter::printClassDeclarationBegin()
|
|
void MessageDeclarationPrinter::printClassDeclarationBegin()
|
|
{
|
|
{
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ProtoClassDeclarationBeginTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ProtoClassDeclarationBeginTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printMetaTypesDeclaration()
|
|
void MessageDeclarationPrinter::printMetaTypesDeclaration()
|
|
@@ -397,7 +397,7 @@ void MessageDeclarationPrinter::printClassBody()
|
|
printSetters();
|
|
printSetters();
|
|
|
|
|
|
Indent();
|
|
Indent();
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ManualRegistrationDeclaration);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ManualRegistrationDeclaration);
|
|
Outdent();
|
|
Outdent();
|
|
|
|
|
|
printSignalsBlock();
|
|
printSignalsBlock();
|
|
@@ -414,7 +414,7 @@ void MessageDeclarationPrinter::printClassBody()
|
|
|
|
|
|
void MessageDeclarationPrinter::printListType()
|
|
void MessageDeclarationPrinter::printListType()
|
|
{
|
|
{
|
|
- mPrinter->Print({{"classname", mName}}, Templates::ComplexListTypeUsingTemplate);
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, Templates::ComplexListTypeUsingTemplate);
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printClassMembers()
|
|
void MessageDeclarationPrinter::printClassMembers()
|
|
@@ -434,7 +434,7 @@ void MessageDeclarationPrinter::printClassMembers()
|
|
|
|
|
|
void MessageDeclarationPrinter::printDestructor()
|
|
void MessageDeclarationPrinter::printDestructor()
|
|
{
|
|
{
|
|
- mPrinter->Print({{"classname", mName}}, "virtual ~$classname$();\n");
|
|
|
|
|
|
+ mPrinter->Print(mTypeMap, "virtual ~$classname$();\n");
|
|
}
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printFieldEnum()
|
|
void MessageDeclarationPrinter::printFieldEnum()
|