mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-04-06 20:52:41 +00:00
Update the generator to be able to handle the new challenges that arose with the new specification, namely: - Enums that do not start with a capital letter - Enums that contain a reserved keyword - Basic handling 'allOf' keys in properties Additionally, the comparison enum deserialisation is now case-insensitive.
31 lines
527 B
Handlebars
31 lines
527 B
Handlebars
class {{className}}Class {
|
|
Q_GADGET
|
|
public:
|
|
enum Value {
|
|
EnumNotSet,
|
|
|
|
{{#each entries as |entry|}}
|
|
{{entry.name}},
|
|
|
|
{{/each}}
|
|
};
|
|
Q_ENUM(Value)
|
|
private:
|
|
explicit {{className}}Class();
|
|
};
|
|
|
|
using {{className}} = {{className}}Class::Value;
|
|
|
|
} // NS DTO
|
|
|
|
namespace Support {
|
|
|
|
using {{className}} = Jellyfin::DTO::{{className}};
|
|
|
|
template <>
|
|
|
|
{{className}} fromJsonValue(const QJsonValue &source, convertType<{{className}}>);
|
|
|
|
template <>
|
|
QJsonValue toJsonValue(const {{className}} &source, convertType<{{className}}>);
|