Skip to content

Commit aed8d8c

Browse files
author
Andres Sevillano
committed
c++ namespace
1 parent 59f7d3a commit aed8d8c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

json/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "Complex Json Schema example",
44
"description": "version 0.0.1",
55
"type": "object",
6-
"namespace": "boilerplateExample",
6+
"namespace": "boilerplate::Example",
77
"cssClass": "boilerplateExample",
88
"metatype": "struct Data",
99
"properties": {

src/boilerplateCodeDoc.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,9 @@ return boilerplateOperator(jsonSchema, *this, jsonSchema.namespace_id, [](const
441441
}
442442
if( parentMetatype.empty() ) { return; } // required
443443

444-
std::string addition = "\n" + parentMetatype + " {\n";
444+
std::string addition {};
445+
if( not namespace_id.empty() ) { addition += "namespace " + namespace_id + " {\n"; }
446+
addition += "\n" + parentMetatype + " {\n\n";
445447

446448
for(const auto& p : properties) {
447449

@@ -454,7 +456,8 @@ return boilerplateOperator(jsonSchema, *this, jsonSchema.namespace_id, [](const
454456
addition += metatype + " " + name + " {};\n";
455457
}
456458

457-
addition += "};"; // parentMetatype
459+
addition += "\n}; // " + parentMetatype + "\n";
460+
if( not namespace_id.empty() ) { addition += "\n} // namespace " + namespace_id + "\n"; }
458461

459462
filtered = addition + filtered;
460463
}

0 commit comments

Comments
 (0)