-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CPPSDK: template updates based on more complex schema generation (#153)
- Loading branch information
1 parent
993c25d
commit 77f2cfc
Showing
17 changed files
with
46 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
WPEFramework::Core::JSON::ArrayType<WPEFramework::Core::JSON::Variant> ${Property}; | ||
WPEFramework::Core::JSON::ArrayType<WPEFramework::Core::JSON::Variant> ${property}Array; | ||
for (auto& element : ${property}) { | ||
${if.object}${items.with.indent}${end.if.object}${if.non.object}${Property}.Add() = element;${end.if.non.object} | ||
${if.object}${items.with.indent}${end.if.object}${if.non.object} ${property}Array.Add() = element;${end.if.non.object} | ||
} | ||
WPEFramework::Core::JSON::Variant ${Property}Variant; | ||
${Property}Variant.Array(${Property}); | ||
jsonParameters.Set(_T("${property}"), ${Property}Variant); | ||
WPEFramework::Core::JSON::Variant ${property}Variant; | ||
${property}Variant.Array(${property}Array); | ||
jsonParameters.Set(_T("${property}"), ${property}Variant); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} jsonValue = ${property}${if.optional}.value()${end.if.optional}; | ||
WPEFramework::Core::JSON::Variant ${Property}(jsonValue.Data()); | ||
jsonParameters.Set(_T("${property}"), ${Property}); | ||
WPEFramework::Core::JSON::Variant ${property}Variant(jsonValue.Data()); | ||
jsonParameters.Set(_T("${property}"), ${property}Variant); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
WPEFramework::Core::JSON::Variant ${Property}(${property}${if.optional}.value()${end.if.optional}); | ||
jsonParameters.Set(_T("${property}"), ${Property}); | ||
WPEFramework::Core::JSON::Variant ${property}Variant(${property}${if.optional}.value()${end.if.optional}); | ||
jsonParameters.Set(_T("${property}"), ${property}Variant); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${if.namespace.notsame}${parent.Title}::${end.if.namespace.notsame} |
12 changes: 6 additions & 6 deletions
12
languages/cpp/templates/parameter-serialization/object-array.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} ${Property}Container; | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} ${property}Container; | ||
${properties} | ||
string ${Property}Str; | ||
${Property}Container.ToString(${Property}Str); | ||
WPEFramework::Core::JSON::VariantContainer ${Property}VariantContainer(${Property}Str); | ||
WPEFramework::Core::JSON::Variant ${Property}Variant = ${Property}VariantContainer; | ||
${Property}.Add() = ${Property}Variant; | ||
string ${property}Str; | ||
${property}Container.ToString(${property}Str); | ||
WPEFramework::Core::JSON::VariantContainer ${property}VariantContainer(${property}Str); | ||
WPEFramework::Core::JSON::Variant ${property}Variant = ${property}VariantContainer; | ||
${property}Array.Add() = ${property}Variant; |
4 changes: 2 additions & 2 deletions
4
languages/cpp/templates/parameter-serialization/object-empty-property.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
WPEFramework::Core::JSON::Variant ${Property}(${property}${if.optional}.value()${end.if.optional}); | ||
jsonParameters.Set(_T("${property}"), ${Property}); | ||
WPEFramework::Core::JSON::Variant ${property}Variant(${property}${if.optional}.value()${end.if.optional}); | ||
jsonParameters.Set(_T("${property}"), ${property}Variant); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
auto element = ${property}${if.impl.optional}.value()${end.if.impl.optional}; | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} ${Property}Container; | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} ${property}Container; | ||
${properties} | ||
string ${Property}Str; | ||
${Property}Container.ToString(${Property}Str); | ||
WPEFramework::Core::JSON::VariantContainer ${Property}VariantContainer(${Property}Str); | ||
WPEFramework::Core::JSON::Variant ${Property} = ${Property}VariantContainer; | ||
jsonParameters.Set(_T("${property}"), ${Property}); | ||
string ${property}Str; | ||
${property}Container.ToString(${property}Str); | ||
WPEFramework::Core::JSON::VariantContainer ${property}VariantContainer(${property}Str); | ||
WPEFramework::Core::JSON::Variant ${property}Variant = ${property}VariantContainer; | ||
jsonParameters.Set(_T("${property}"), ${property}Variant); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
${shape} ${if.non.const}${if.non.anyOf}${if.non.array}${if.non.object}${base.Title}Container.${Property} = element.${property}${if.optional}.value()${end.if.optional};${end.if.non.object}${end.if.non.array}${end.if.non.anyOf}${end.if.non.const} | ||
${shape} ${if.non.const}${if.non.anyOf}${if.non.array}${if.non.object}${base.title}Container.${Property} = element.${property}${if.optional}.value()${end.if.optional};${end.if.non.object}${end.if.non.array}${end.if.non.anyOf}${end.if.non.const} |
2 changes: 1 addition & 1 deletion
2
languages/cpp/templates/parameter-serialization/sub-property/anyOfSchemaShape.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
${base.Title}Container.${Property.dependency}${Property} = element${property.dependency}${if.impl.optional}.value()${end.if.impl.optional}.${property}${if.optional}.value()${end.if.optional}; | ||
${base.title}Container.${Property.dependency}${Property} = element${property.dependency}${if.impl.optional}.value()${end.if.impl.optional}.${property}${if.optional}.value()${end.if.optional}; |
10 changes: 4 additions & 6 deletions
10
languages/cpp/templates/parameter-serialization/sub-property/array.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
WPEFramework::Core::JSON::ArrayType<WPEFramework::Core::JSON::Variant> ${Property}; | ||
${type} ${property} = element.${property}${if.impl.array.optional}.value()${end.if.impl.array.optional}; | ||
WPEFramework::Core::JSON::ArrayType<${json.type}> ${property}Array; | ||
${type} ${property} = element${property.dependency}${if.impl.optional}.value()${end.if.impl.optional}.${property}${if.impl.array.optional}.value()${end.if.impl.array.optional}; | ||
for (auto& element : ${property}) { | ||
${if.object}${items.with.indent}${end.if.object}${if.non.object}${Property}.Add() = element;${end.if.non.object} | ||
${if.object}${items.with.indent}${end.if.object}${if.non.object} ${property}Array.Add() = element;${end.if.non.object} | ||
} | ||
WPEFramework::Core::JSON::Variant ${Property}Variant; | ||
${Property}Variant.Array(${Property}); | ||
jsonParameters.Set(_T("${property}"), ${Property}Variant); | ||
${base.title}Container.${Property.dependency}Add(_T("${property}"), &${property}Array); |
2 changes: 1 addition & 1 deletion
2
languages/cpp/templates/parameter-serialization/sub-property/const.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
${base.Title}Container.${Property.dependency}${Property} = element${property.dependency}.${property}${if.optional}.value()${end.if.optional}; | ||
${base.title}Container.${Property.dependency}${Property} = element${property.dependency}.${property}${if.optional}.value()${end.if.optional}; |
1 change: 1 addition & 0 deletions
1
languages/cpp/templates/parameter-serialization/sub-property/namespace.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${if.namespace.notsame}${parent.Title}::${end.if.namespace.notsame} |
8 changes: 2 additions & 6 deletions
8
languages/cpp/templates/parameter-serialization/sub-property/object-array.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} ${Property}Container; | ||
${if.namespace.notsame}Firebolt::${info.Title}::${end.if.namespace.notsame}JsonData_${title} ${property}Container; | ||
${properties} | ||
string ${Property}Str; | ||
${Property}Container.ToString(${Property}Str); | ||
WPEFramework::Core::JSON::VariantContainer ${Property}VariantContainer(${Property}Str); | ||
WPEFramework::Core::JSON::Variant ${Property}Variant = ${Property}VariantContainer; | ||
${Property}.Add() = ${Property}Variant; | ||
${property}Array.Add() = ${property}Container; |
2 changes: 1 addition & 1 deletion
2
languages/cpp/templates/parameter-serialization/sub-property/property.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
${shape} ${if.non.const}${if.non.anyOf}${if.non.array}${if.non.object}${base.Title}Container.${Property.dependency}${Property} = element${property.dependency}${if.impl.optional}.value()${end.if.impl.optional}.${property}${if.optional}.value()${end.if.optional};${end.if.non.object}${end.if.non.array}${end.if.non.anyOf}${end.if.non.const} | ||
${shape} ${if.non.const}${if.non.anyOf}${if.non.array}${if.non.object}${base.title}Container.${Property.dependency}${Property} = element${property.dependency}${if.impl.optional}.value()${end.if.impl.optional}.${property}${if.optional}.value()${end.if.optional};${end.if.non.object}${end.if.non.array}${end.if.non.anyOf}${end.if.non.const} |
2 changes: 1 addition & 1 deletion
2
languages/cpp/templates/result-instantiation/additionalProperties.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/* anyOf schema shape is not supported right now */ | ||
/* anyOf schema shape is not supported right now */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters