September 29, 2016 struct to json/yaml/xml/whatever codegen | ||||
|---|---|---|---|---|
| ||||
Is anyone aware of a tool which does something akin to the following:
Given a C-like definition, automatically generate pure C code with no dependencies.
Input c-struct:
struct Person
{
int id;
char* name;
}
Output minimal c-code:
void dumpPerson(Person* p)
{
printf("<Person><id>%d</id><name>%s</name></Person>", p->id, p->name);
}
It's easy to write in D... just want to avoid reinventing the wheel.
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply