Advertisement

SWIG question

Started by August 13, 2004 02:55 PM
-1 comments, last by CoffeeMug 20 years 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