`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-6.0 [1]).
[1]: https://diamon.org/ctf/files/CTF2-SPECRC-6.0rB.html#metadata-stream
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id869bb4fc735a75fbe16827dfb6abed62d13467b
Change-Id: I9249645496012f8bddccbdc866af087c3d3bc549
This page took 0.025173 seconds and 5 git commands to generate.