|
Boost : |
Subject: Re: [boost] Any interest in bitstream class?
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2013-06-29 08:06:22
> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Adam Wulkiewicz
> Sent: Saturday, June 29, 2013 12:43 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Any interest in bitstream class?
>
> Hi,
>
> Paul Long wrote:
> > What do you think?
> > Should the bitstream library support multiple endian schemes in the
> > bit stream or is big endian enough?
> >
>
> Various communication protocols or files may define the endianess of data differently. There are
even
> cases like TIFF files which define the endianess of data in the header. Therefore this type of
library should
> support different endianesses. It should also probably support switching them for the same stream
> multiple times. E.g. some manipulators could be
> provided:
>
> namespace bs = boost::bitstream;
>
> mystream >> bs::big >> my_int16 >> my_IEEE754_float_32 >> bs::little >> other_int16;
>
> Of course the endianess of variables on a specific platform should be taken into account.
>
> It could also support some non-C++ formats like 16-bit half precision or 128-bit quad precision
floats.
> Some typedefs would probably be required in namespace boost::bitstream.
A proposal for floating-point typedefs
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf
may provide some help - eventually ;-)
For example:
"Specifying 128-bit precision
The proposed typedef float128_t provides a standardized way to specify quadruple-precision
(Quadruple-precision floatingpoint format) in C++."
Paul
--- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk