25 lines
573 B
Django/Jinja
25 lines
573 B
Django/Jinja
/**
|
|
* @file struct2json.cpp
|
|
*
|
|
* @brief Implementation file for converting structs to JSON objects.
|
|
*
|
|
* @note This file is auto-generated by a script on {{ timestamp }}.
|
|
*
|
|
* @author Marcel Peterkau
|
|
* @date {{ date }}
|
|
*/
|
|
|
|
|
|
#include "struct2json.h"
|
|
|
|
{% for var_name, var_info in structs.items() -%}
|
|
void generateJsonObject_{{ var_name }}(JsonObject data)
|
|
{
|
|
{% for field_name, field_type in var_info['fields'].items() -%}
|
|
data["{{ field_name }}"] = {{ var_name }}.{{ field_name }};
|
|
{% endfor -%}
|
|
}
|
|
|
|
{% endfor %}
|
|
|
|
// CODEGENERATOR_CHECKSUM: {{ checksum }} |