fraillt/bitsery

Is there any way to deserialize binary file directly to a not bitsery class?

yigudove opened this issue · 1 comments

So far I read from binary tile to a bitsery class and then translate it to another c++ class like below:

// deserialize from binary files
BitseryMap::MapInfo bitseryMap;
std::fstream s{ filename, s.binary | s.in };
bitsery::quickDeserialization<bitsery::InputStreamAdapter>(s, bitseryMap);

// translate
MyMapClass myMap;
TranslateFunction(bitseryMap, myMap);

I wonder whether there is a possible way that can directly deserialize binary files to MyMapClass.

I see... I can directly use MyMapClass for Serialization. Bitsery is different from protobuf and do not need a "proto" file.