src/cpp-common: add bt2c::parseJson() functions (value mode)
This patch adds two new versions of bt2c::parseJson() which accept the
same parameters as the current "listener mode" versions, except for a
missing listener, and return some resulting
JSON value (`bt2c::JsonVal`).
This is part of an effort to support CTF2‑SPEC‑2.0 [1]. It will be
easier to convert CTF 2 metadata stream fragments using JSON value
objects than using the listener mode version of bt2c::parseJson()
directly.
`baseOffset` is also added to the offset of a text location when
creating the text location of any JSON value object to create. This will
be needed when parsing a CTF 2 fragment: the line and column numbers are
local to the fragment, but the offset is from the beginning of the whole
metadata stream. Kind of confusing, but I wouldn't know what an RS byte
means in terms of lines/columns anyway (different text editor could
interpret it in different ways).
[1]: https://diamon.org/ctf/CTF2-SPEC-2.0.html
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I3e9662f6632d10f11c08c178342785886f664797
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7480
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12684
This page took 0.02458 seconds and 4 git commands to generate.