endian is a simple C++ library for conversion between big and little endian data representations and provide stream-like interface for accessing a fixed-size buffer.
endian::big_endian structures acts
like function containers for conversion to little/big endian. In both
structures there are two types of functions put and get, each have
specializations for different integer types.
endian::endian_stream class is stream-like interface used for
writing and reading data either to or from a stream or storage object.
Examples for using endian can be found in
test/src and in
The library itself is header-only so essentially to use it you just have to clone the repository and setup the right include paths in the project where you would like to use it.
The unit tests for the endian library are located in the
We use the Google Unit Testing Framwork (gtest) to drive the unit tests. To build and run the test run:
python waf configure python waf
Depending on the platform you should see a test binary called
endian_test in (extension also depends on operating system e.g .exe
platform is typically either linux, win32 or darwin depending on
your operating system
endian is available under the BSD license.