🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

SWIG question

Started by
-1 comments, last by CoffeeMug 19 years, 11 months ago
I've done quite a bit of searching and couldn't find the answer to this question. I have a set of C++ structures that are serialized to a file using simple fwrite(). There is no formatting, just a dump of the memory into a file from an existing C++ application. I am now writing a C# application that must load the data from the files back into C++ structures and do some operations on the fields. I am successfully using SWIG to generate proxy classes, however I'm not sure how to go about the serialization. Ideally I'd just be able to copy data I read from the file into the C++ structures' memory. I am not sure how to do this from C# since the proxy classes don't expose the underlying memory model. I also don't like the idea of inlining my own code into the interface file as I have hundreds of structures and I specifically chose SWIG because it can generate proxy code without me having to specify the interface manually. Does SWIG offer any functionality that may help me solve this problem?

This topic is closed to new replies.

Advertisement