I am working on a tool to auto-generate some C/C++ code by parsing a file. Is there a tool that provides an interface to write C/C++ code like this
Struct* pStruct = generator->beginStruct("Material");
{
pStruct->addVariable("Buffer*", "pBuffer");
pStruct->addVariable("Texture*", "pTexture");
}
generator->endStruct(pStruct);
/* Output file
struct Material
{
Buffer* pBuffer;
Texture* pTexture;
};
*/
Now I know its quite trivial to write a tool like this but I am curious to know whether a tool already exists. Seems just like a tool generating json/xml but for C++.
Note: I won't be doing any fancy stuff like templates or inheritance. Just pure C structs.
Thank you