cpp-common: add `readFixedLenInt()` function
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 25 May 2022 15:20:53 +0000 (11:20 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 11 Sep 2023 15:24:02 +0000 (11:24 -0400)
commite0a3ddd47246163b70f9764c0f147807ff1fc0ea
tree2e007440e2af184e1ae6960e0dbfa14bca8437cf
parent82a36560253182a9e8bacf6a7a9fc30fc2826f71
cpp-common: add `readFixedLenInt()` function

This function template reads an integer from a buffer without assuming
its byte order.

For example, this is needed when reading the magic number from a data
buffer of unknown byte order. If needed, the user then has to manually
swap byte order of that integer to get its native byte order

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Ia94ee3a3ffc7caaa46a46defead3e23da0a4c2b2
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8111
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10841
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/read-fixed-len-int.hpp
This page took 0.024748 seconds and 4 git commands to generate.