Add `bt2_common::UuidView`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 17 Dec 2020 04:30:00 +0000 (23:30 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 28 Jan 2022 16:22:26 +0000 (11:22 -0500)
commitb239731a3e335b5f7371fcfcfa553013a58733e3
tree51d50fa31f7e9b72c653557b632b82029b4c0e39
parent64ded3fba41e6ad038a67a06cf78faf4ffaa753b
Add `bt2_common::UuidView`

This patch adds the `bt2_common::UuidView` class which is like
`std::string_view`, but for UUIDs.

You cannot modify the underlying UUID (`const std::uint8_t *`).

Compare UUID views with operator==() and operator!=().

Get a UUID view's data with its data() method.

Get a UUID view's data size with its size() method.

Get the canonical string of a UUID view with its string() method, which
returns a new `std::string` instance.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icc633b44b852383d223ff8e73034736f47b64579
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4601
src/cpp-common/uuid-view.hpp [new file with mode: 0644]
This page took 0.024322 seconds and 4 git commands to generate.