`ctf` plugin: add metadata stream parser utilities
This patch adds:
ctf::src::getMetadataStreamMajorVersion():
Returns the major version of a metadata stream based on its first
byte.
ctf::src::createMetadataStreamParser(MetadataStreamMajorVersion, ...):
Creates and returns a CTF metadata stream parser of which the
concrete class depends on some major version.
ctf::src::createMetadataStreamParser(const std::uint8_t *, ...):
Creates and returns a CTF metadata stream parser of which the
concrete class depends on the first byte of some data.
ctf::src::parseMetadataStream():
Parses a whole metadata stream, returning the resulting trace class
and optional metadata stream UUID.
This is the preferred way to parse a whole metadata stream as it
calls the static parse() method of some concrete parser class which
may contain more validation. For example,
ctf::src::Ctf2MetadataStreamParser::parse() throws if there's no
resulting trace class or if the current resulting trace class has no
data stream classes (required by CTF2‑SPEC‑2.0 [1]).
[1]: https://diamon.org/ctf/CTF2-SPEC-2.0.html#metadata-stream
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id869bb4fc735a75fbe16827dfb6abed62d13467b
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12737
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
This page took 0.025003 seconds and 4 git commands to generate.