Cross-platform and language (de)serialization

后端 未结 7 1107
一个人的身影
一个人的身影 2021-02-07 22:13

I\'m looking for a way to serialize a bunch of C++ structs in the most convenient way so that the serialization is portable across C++ and Java (at a minimum) and across 32bit/6

7条回答
  •  青春惊慌失措
    2021-02-07 22:42

    I'd suggest saving the data with SQLite database. The structs can be stored as database rows in SQLite tables.

    The resulting database file is binary compatible across many different platforms and can be stored as a BLOB in your main database. I believe the file size is comparable to compressed XML file with the same data, but memory usage during processing will be significantly less than XML DOM.

提交回复
热议问题