comparison Resources/CodeGeneration/template.in.h.j2 @ 670:5dd496343fad

Restored missing code + fixed key ordering when generating code
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 15 May 2019 18:29:42 +0200
parents 84af39146e76
children 1b47f17863ba
comparison
equal deleted inserted replaced
666:daf43666bbc2 670:5dd496343fad
392 #pragma region {{struct['name']}} 392 #pragma region {{struct['name']}}
393 #endif //_MSC_VER 393 #endif //_MSC_VER
394 394
395 struct {{struct['name']}} 395 struct {{struct['name']}}
396 { 396 {
397 {% if struct %}{% if struct['fields'] %}{% for key in struct['fields']%} {{CanonToCpp(struct['fields'][key]['type'])}} {{key}}; 397 {% if struct %}{% if struct['fields'] %}{% for key in sorted(struct['fields']) %} {{CanonToCpp(struct['fields'][key]['type'])}} {{key}};
398 {% endfor %}{% endif %}{% endif %} 398 {% endfor %}{% endif %}{% endif %}
399 {{struct['name']}}({% if struct %}{% if struct['fields'] %}{% for key in struct['fields']%}{{CanonToCpp(struct['fields'][key]['type'])}} {{key}} = {% if struct['fields'][key]['defaultValue'] %}{{DefaultValueToCpp(rootName,enums,struct['fields'][key])}} {%else%} {{CanonToCpp(struct['fields'][key]['type'])}}() {%endif%} {{ ", " if not loop.last }}{% endfor %}{% endif %}{% endif %}) 399 {{struct['name']}}({% if struct %}{% if struct['fields'] %}{% for key in sorted(struct['fields']) %}{{CanonToCpp(struct['fields'][key]['type'])}} {{key}} = {% if struct['fields'][key]['defaultValue'] %}{{DefaultValueToCpp(rootName,enums,struct['fields'][key])}} {%else%} {{CanonToCpp(struct['fields'][key]['type'])}}() {%endif%} {{ ", " if not loop.last }}{% endfor %}{% endif %}{% endif %})
400 { 400 {
401 {% if struct %}{% if struct['fields'] %}{% for key in struct['fields']%} this->{{key}} = {{key}}; 401 {% if struct %}{% if struct['fields'] %}{% for key in struct['fields']%} this->{{key}} = {{key}};
402 {% endfor %}{% endif %}{% endif %} } 402 {% endfor %}{% endif %}{% endif %} }
403 }; 403 };
404 404