cpp-common/bt2: return `bt2c::CStringView` instead of `const char *`
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 11 Dec 2023 21:10:01 +0000 (16:10 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
commite7f0f07bea73c3fdf14bbc919bfd44bff3eb85e1
treeb56b6b61afe6beca051ee068e0a46d914251f63b
parent339e8bc45d45a998c7d530ebe8d2bf0d579aa60a
cpp-common/bt2: return `bt2c::CStringView` instead of `const char *`

This patch makes any method in `cpp-common/bt2` return
`bt2c::CStringView` instead of `const char *` when possible to improve
the usability of the wrapping API.

In `bt2::CommonStringField` and `bt2::CommonStringValue`, I didn't
bother having a different raw value type to set vs. get, therefore the
value() getter returns `bt2c::CStringView` while the value() setter has
overloads for `bt2c::CStringView`, `const char *`, and
`const std::string&`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Iab7c7ea9a97035b9bea018f918a5d52516ab676c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11486
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2/clock-class.hpp
src/cpp-common/bt2/component-port.hpp
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/field.hpp
src/cpp-common/bt2/plugin-dev.hpp
src/cpp-common/bt2/raw-value-proxy.hpp
src/cpp-common/bt2/self-component-class.hpp
src/cpp-common/bt2/self-component-port.hpp
src/cpp-common/bt2/trace-ir.hpp
src/cpp-common/bt2/value.hpp
This page took 0.024886 seconds and 4 git commands to generate.