Parsing a binary file. What is a modern way?

后端 未结 10 2111
悲哀的现实
悲哀的现实 2021-01-30 01:41

I have a binary file with some layout I know. For example let format be like this:

  • 2 bytes (unsigned short) - length of a string
  • 5 bytes (5 x chars) - the
10条回答
  •  长发绾君心
    2021-01-30 02:11

    Use a serialization library. Here are a few:

    • Boost serialization and Boost fusion
    • Cereal (my own library)
    • Another library called cereal (same name as mine but mine predates theirs)
    • Cap'n Proto

提交回复
热议问题