Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steinwurf/endian
C++ library for conversion between big and little endian data representations.
https://github.com/steinwurf/endian
endian endianness
Last synced: about 2 months ago
JSON representation
C++ library for conversion between big and little endian data representations.
- Host: GitHub
- URL: https://github.com/steinwurf/endian
- Owner: steinwurf
- License: bsd-3-clause
- Created: 2016-02-10T14:32:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-08-23T07:41:50.000Z (over 1 year ago)
- Last Synced: 2024-04-16T03:46:58.268Z (8 months ago)
- Topics: endian, endianness
- Language: C++
- Homepage: https://steinwurf-endian.netlify.app/latest/
- Size: 1.86 MB
- Stars: 27
- Watchers: 9
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
======
endian
======|Linux make-specs| |Windows make-specs| |MacOS make-specs| |Linux CMake| |Windows CMake| |MacOS CMake| |Raspberry Pi| |Valgrind| |No Assertions| |Clang Format| |Cppcheck|
.. |Linux make-specs| image:: https://github.com/steinwurf/endian/actions/workflows/linux_mkspecs.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/linux_mkspecs.yml
.. |Windows make-specs| image:: https://github.com/steinwurf/endian/actions/workflows/windows_mkspecs.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/windows_mkspecs.yml.. |MacOS make-specs| image:: https://github.com/steinwurf/endian/actions/workflows/macos_mkspecs.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/macos_mkspecs.yml
.. |Linux CMake| image:: https://github.com/steinwurf/endian/actions/workflows/linux_cmake.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/linux_cmake.yml.. |Windows CMake| image:: https://github.com/steinwurf/endian/actions/workflows/windows_cmake.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/windows_cmake.yml
.. |MacOS CMake| image:: https://github.com/steinwurf/endian/actions/workflows/macos_cmake.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/macos_cmake.yml
.. |Raspberry Pi| image:: https://github.com/steinwurf/endian/actions/workflows/raspberry_pi.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/raspberry_pi.yml.. |Clang Format| image:: https://github.com/steinwurf/endian/actions/workflows/clang-format.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/clang-format.yml.. |No Assertions| image:: https://github.com/steinwurf/endian/actions/workflows/nodebug.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/nodebug.yml.. |Valgrind| image:: https://github.com/steinwurf/endian/actions/workflows/valgrind.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/valgrind.yml.. |Cppcheck| image:: https://github.com/steinwurf/endian/actions/workflows/cppcheck.yml/badge.svg
:target: https://github.com/steinwurf/endian/actions/workflows/cppcheck.yml.. image:: https://raw.githubusercontent.com/steinwurf/endian/master/endian.png
:width: 300endian 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... contents:: Table of Contents:
:local:Usage
-----The ``endian::little_endian`` and ``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.The ``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 ``example/src``
Header-only
...........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.Unit testing
------------The unit tests for the endian library are located in the ``test/src``
folder.We use the Google Unit Testing Framwork (gtest) to drive the unit tests. To
build and run the test run::python waf configure
python wafDepending on the platform you should see a test binary called
``endian_test`` in (extension also depends on operating system e.g `.exe`
for Windows)::build/platform/test
Where ``platform`` is typically either linux, win32 or darwin depending on
your operating systemUse as Dependency in CMake
--------------------------To depend on this project when using the CMake build system, add the following
in your CMake build script::add_subdirectory("/path/to/endian" endian)
target_link_libraries( steinwurf::endian)Where ```` is replaced by your target.
License
-------endian is available under the BSD license.