Macros
macro makeDeserializable(types: varargs[typedesc]; public: static[bool] = false; duplicateCheck: static[bool] = true; debugOutput: static[bool] = false; debugTreeOutput: static[bool] = false)
-
Generate deserialize procedure for your type. Use public parameter to export.
Works only for objects and ref objects.
Compile with -d:debugMakeDeserializable to see macro output. Compile with -d:debugMakeDeserializableTree to see macro output as NimNode tree.
Example:
makeDeserializable(Foo) # Use array of types if you want to make deserializable many types makeDeserializable([ Foo, Bar ])
Source Edit