1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 17:25:17 +00:00
harbour-sailfin/core/codegen/enum_implementation.hbs
Chris Josten b9b08ab384 Make model code compileable
This disables some application level logic, but I'm going to rewrite
that using Lager anyway.
2021-03-20 16:29:31 +01:00

26 lines
473 B
Handlebars

{{className}}Class::{{className}}Class() {}
} // NS DTO
namespace Support {
using {{className}} = Jellyfin::DTO::{{className}};
template <>
{{className}} fromJsonValue<{{className}}>(const QJsonValue &source) {
if (!source.isString()) return {{className}}::EnumNotSet;
QString str = source.toString();
{{#each values as |value|}}
if (str == QStringLiteral("{{value}}")) {
return {{className}}::{{value}};
}
{{/each}}
return {{className}}::EnumNotSet;
}