quicktype-core 7.0.24 → 7.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1343,6 +1343,20 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1343
1343
  this.emitConstraintClasses();
1344
1344
  this.ensureBlankLine();
1345
1345
  }
1346
+ this.ensureBlankLine();
1347
+ var untypedMacroName = new String("NLOHMANN_UNTYPED_");
1348
+ var optionalMacroName = new String("NLOHMANN_OPTIONAL_");
1349
+ this._namespaceNames.forEach(function (value) {
1350
+ // We can't use upper name, because namespaces are case sensitive
1351
+ untypedMacroName += value;
1352
+ untypedMacroName += "_";
1353
+ optionalMacroName += value;
1354
+ optionalMacroName += "_";
1355
+ });
1356
+ untypedMacroName += "HELPER";
1357
+ untypedMacroName += "HELPER";
1358
+ this.emitLine("#ifndef " + untypedMacroName);
1359
+ this.emitLine("#define " + untypedMacroName);
1346
1360
  this.emitBlock([
1347
1361
  "inline json get_untyped(", this.withConst("json"), " & j, ", this.withConst("char"), " * property)"
1348
1362
  ], false, () => {
@@ -1357,8 +1371,12 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1357
1371
  ], false, () => {
1358
1372
  this.emitLine("return get_untyped(j, property.data());");
1359
1373
  });
1374
+ this.emitLine("#endif");
1360
1375
  this.ensureBlankLine();
1361
1376
  if (this.haveUnions || this.haveOptionalProperties) {
1377
+ this.ensureBlankLine();
1378
+ this.emitLine("#ifndef " + optionalMacroName);
1379
+ this.emitLine("#define " + optionalMacroName);
1362
1380
  this.emitLine("template <typename T>");
1363
1381
  this.emitBlock(["inline ", optionalType, "<T> get_optional(", this.withConst("json"), " & j, ", this.withConst("char"), " * property)"], false, () => {
1364
1382
  this.emitBlock(["if (j.find(property) != j.end())"], false, () => {
@@ -1371,6 +1389,7 @@ class CPlusPlusRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
1371
1389
  this.emitBlock(["inline ", optionalType, "<T> get_optional(", this.withConst("json"), " & j, std::string property)"], false, () => {
1372
1390
  this.emitLine("return get_optional<T>(j, property.data());");
1373
1391
  });
1392
+ this.emitLine("#endif");
1374
1393
  this.ensureBlankLine();
1375
1394
  }
1376
1395
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "7.0.24",
3
+ "version": "7.0.26",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -45,6 +45,6 @@
45
45
  "fs": false
46
46
  },
47
47
  "config": {
48
- "commit": "2dc22cb8dee03e613da69ca99ab2b4057f5bf68a"
48
+ "commit": "7599c476f860ff6a60dca93e3cebfeed84dbdf75"
49
49
  }
50
50
  }