Merge pull request #508 from quicktype/no-empty-nlohmann
Don't emit empty "nlohmann" namespace in C++. Fixes #504
This commit is contained in:
Коммит
6fbe248e32
|
@ -331,6 +331,10 @@ export abstract class ConvenienceRenderer extends Renderer {
|
|||
return !this._namedUnions.isEmpty();
|
||||
}
|
||||
|
||||
protected get haveNamedTypes(): boolean {
|
||||
return !this._namedTypes.isEmpty();
|
||||
}
|
||||
|
||||
protected get haveUnions(): boolean {
|
||||
return this._haveUnions;
|
||||
}
|
||||
|
|
|
@ -754,6 +754,7 @@ inline ${optionalType}<T> get_optional(const json &j, const char *property) {
|
|||
this.emitNamespace(this._namespaceName, this.emitTypes);
|
||||
}
|
||||
if (this._justTypes) return;
|
||||
if (!this.haveNamedTypes) return;
|
||||
|
||||
this.ensureBlankLine();
|
||||
this.emitNamespace("nlohmann", () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче