|
@@ -75,18 +75,18 @@ void MessageDeclarationPrinter::printClassDeclaration()
|
|
|
|
|
|
void MessageDeclarationPrinter::printClassDeclarationPrivate()
|
|
|
{
|
|
|
- mPrinter->Print({{"namespace", mTypeMap["classname"] + Templates::QtProtobufNestedNamespace}}, Templates::NamespaceTemplate);
|
|
|
- common::iterateNestedMessages(mDescriptor, [this](const ::google::protobuf::Descriptor *nestedMessage) {
|
|
|
- MessageDeclarationPrinter nesterPrinter(nestedMessage, mPrinter);
|
|
|
- nesterPrinter.printClassDeclarationPrivate();
|
|
|
- });
|
|
|
- mPrinter->Print(Templates::SimpleBlockEnclosureTemplate);
|
|
|
-
|
|
|
+ if (common::hasNestedMessages(mDescriptor)) {
|
|
|
+ mPrinter->Print({{"namespace", mTypeMap["classname"] + Templates::QtProtobufNestedNamespace}}, Templates::NamespaceTemplate);
|
|
|
+ common::iterateNestedMessages(mDescriptor, [this](const ::google::protobuf::Descriptor *nestedMessage) {
|
|
|
+ MessageDeclarationPrinter nesterPrinter(nestedMessage, mPrinter);
|
|
|
+ nesterPrinter.printClassDeclarationPrivate();
|
|
|
+ });
|
|
|
+ mPrinter->Print(Templates::SimpleBlockEnclosureTemplate);
|
|
|
+ }
|
|
|
printComments(mDescriptor);
|
|
|
printClassDeclarationBegin();
|
|
|
printClassBody();
|
|
|
encloseClass();
|
|
|
- printListType();
|
|
|
}
|
|
|
|
|
|
void MessageDeclarationPrinter::printCopyFunctionality()
|
|
@@ -418,11 +418,6 @@ void MessageDeclarationPrinter::printClassBody()
|
|
|
printClassMembers();
|
|
|
}
|
|
|
|
|
|
-void MessageDeclarationPrinter::printListType()
|
|
|
-{
|
|
|
- mPrinter->Print(mTypeMap, Templates::ComplexListTypeUsingTemplate);
|
|
|
-}
|
|
|
-
|
|
|
void MessageDeclarationPrinter::printClassMembers()
|
|
|
{
|
|
|
Indent();
|