updated CodeGeneration

This commit is contained in:
2024-01-09 20:47:28 +01:00
parent ac28ab21d4
commit 157d59963c
16 changed files with 357 additions and 171 deletions

View File

@@ -0,0 +1,23 @@
/**
* @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 %}