Skip to content

Custom general type #36

@Chlumsky

Description

@Chlumsky

Another idea I had was to support miscellaneous types in the structures, in different ways:

Converted type

This way, a type in the structure would be converted from / to a type supported by the generator. For example a timestamp type, represented by a string in the JSON, and able to be converted from / to a std::string. Each type like this would have an API template for both conversions.

Custom parse / serialize implementation

Another possibility would be that the custom type would have to provide an implementation of the parse and serialize functions of itself. This option is just an idea and probably should not be implemented.

String conversion

A sort-of hybrid between the two previous options (and raw JSON string #32) would be a type that would parse / serialize itself but not directly. Instead the parser / serializer would first construct a string object and use that to interface with the custom type's API. This would be another way to implement custom number types (#35) if they provide a conversion from / to string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-generationInvolves generation of parser / serializer codeenhancementEnhancement of existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions