Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
/**
* Json <-> DDS conversion routines
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Ehrlicher, SLSE, 2017-11-30
*/
{% autoescape off %}
// filename: {{ namespace_abbr }}_json.h
#pragma once
#include "{{ namespace_abbr }}.hpp"
#include "{{ namespace_abbr }}_export.h"
#include <QJsonObject>
#include <QJsonValue>
namespace {{ namespace }}
{
template<typename T>
struct type{};
template<typename T>
T fromJson(const QJsonValue &val, type<T>);
template<typename T>
T fromJson(const QJsonValue &val)
{
return fromJson(val, type<T>{});
}
{% for dt in jsonTopics %}
// {{ dt.name }}
{{ namespace_abbr_upper }}_COMMON_EXPORT QJsonObject toJson(const {{ dt.name }} &element);
template<> {{ namespace_abbr_upper }}_COMMON_EXPORT {{ dt.name }} fromJson(const QJsonValue &val, type<{{ dt.name }}>);
{{ namespace_abbr_upper }}_COMMON_EXPORT QJsonValue toJson(const std::vector< {{ dt.name }} > &element);
template<> {{ namespace_abbr_upper }}_COMMON_EXPORT std::vector<{{ dt.name }}> fromJson(const QJsonValue &value, type< std::vector< {{ dt.name }} > >);
{% endfor %}
//
// extensions to support sequence of seqence of Non-POD :
//
} // namespace {{ namespace }}
{% endautoescape %}