Boost logo

Boost Users :

Subject: Re: [Boost-users] Convert big endian to little endian (floating point values)
From: Maarten de Vries (maarten_at_[hidden])
Date: 2015-12-09 03:37:50


On 8 December 2015 at 23:18, Martin Vymazal <martin.vymazal_at_[hidden]>
wrote:

> On 2015-12-08 22:48, Maarten de Vries wrote:
>
>> Of course, not relying on the platform specific bit representation of
>> primitive data types when serializing data is a much better idea.
>>
>> -- Maarten
>>
>
> What would be a possible approach to save the data without 'relying on the
> platform specific bit representation of primitive data types' as you put
> it? I can not save the data as plain ascii text, because the files would
> simply be huge (the're already big as they are). Is there some more
> intelligent solution? I'm not a software engineer, so I'd be happy to hear
> what is the common practice here.
>
> Martin
>

​
If you're interested:

You can still use a binary format, though it depends on your needs. You
could look at boost serialization [1]. I've never worked with it, so I
can't comment on performance (either in terms of speed or serialized size).
But in theory it solves the problem of saving and loading data to/from
files (and more).

Another option might be Binn [2]. It's C but it looks simple and clean
enough (although I also never worked with it).

[1] http://www.boost.org/doc/libs/1_59_0/libs/serialization/doc/index.html
[2] https://github.com/liteserver/binn%e2%80%8b



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net