src/cpp-common: add bt2c::bt2ValueFromJsonVal() function
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 8 Dec 2023 20:55:05 +0000 (20:55 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commit4a5a43f6da988c96af3e930e8a8416ee8d118820
tree0b10d54c578ebdd6bf0346d3c34f438e4974c908
parent40a18c0b89fa1b38178c9a8d4be029e925d1f081
src/cpp-common: add bt2c::bt2ValueFromJsonVal() function

This patch adds the bt2c::bt2ValueFromJsonVal() function which
converts a JSON value object (`bt2c::JsonVal`) to a Babeltrace 2
value object (`bt2::Value::Shared`, wrapping a shared `bt_value *`).

The JSON value classes are a superset of the Babeltrace 2 value ones:
there's a dedicated `bt2c::JsonNullVal` class, whereas
libbabeltrace2 uses a null value singleton, and `bt2c::JsonVal`
has a text location member.

This is part of an effort to support CTF2‑SPEC‑2.0 [1]. This function
will be useful to convert JSON user attributes to Babeltrace 2 values
directly (this step doesn't need validation).

[1]: https://diamon.org/ctf/CTF2-SPEC-2.0.html

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: If3f0859202aa2ef329048ca5775883059e2b6e50
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7486
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12686
src/Makefile.am
src/cpp-common/bt2c/bt2-value-from-json-val.cpp [new file with mode: 0644]
src/cpp-common/bt2c/bt2-value-from-json-val.hpp [new file with mode: 0644]
This page took 0.024065 seconds and 4 git commands to generate.