AccurateRip DBAR Parser module

Parse a stream in AccurateRip HTTP-Response format to a DBAR object.

Functions parse_stream() and parse_file() can parse a stream to a DBAR object, which provdes access to all values by their respective indices.

A DBARBlockHeader is a representation of the header of a block within a DBAR file. A DBARTriplet represents the three values each block contains for each track.

A DBARBlock is a representation of a single indexed block of a DBAR object. The lifetime of a DBARBlock must not exceed the lifetime of the DBAR object it was constructed from.

When parsing, a DBARBuilder can be passed to the parse() functions as a ParseHandler that constructs the DBAR object from the input stream. Alternatively, custom implementations of ParseHandler can be used.

DBARErrorHandler is the default ParseErrorHandler implementation that just throws a StreamParseException an each error. Throwing a StreamParseException is the default behaviour in case no ParseErrorHandler is provided. Alternatively, custom implementations of ParseErrorHandler can be used.

Classes

class arcstk::v_1_0_0::DBAR
Represents the content of dBAR file.
class arcstk::v_1_0_0::DBARBlock
A block in a DBAR.
class arcstk::v_1_0_0::DBARBlockHeader
The header of a DBARBlock.
class arcstk::v_1_0_0::DBARBuilder
ParseHandler to build a DBAR object.
class arcstk::v_1_0_0::DBARErrorHandler
Default ParseErrorHandler for parsing DBAR objects.
class arcstk::v_1_0_0::DBARTriplet
A triplet in a DBARBlock.
class arcstk::v_1_0_0::ParseErrorHandler
Interface: error handling while parsing a dBAR format.
class arcstk::v_1_0_0::ParseHandler
Interface: parsing a byte stream in dBAR format.
class arcstk::v_1_0_0::StreamParseException
Reports a read error during parsing a binary stream.

Functions

auto is_valid_arcs(const uint32_t value) -> bool
Check a parsed value whether it is a valid ARCS (also frame 450 ARCS).
auto is_valid_confidence(const unsigned value) -> bool
Check a parsed value whether it is a valid confidence.
auto load_file(const std::string& filename) -> DBAR
Read an AccurateRip response file to a DBAR object.
auto parse_file(const std::string& filename, ParseHandler* p, ParseErrorHandler* e) -> uint32_t
Parse a file.
auto parse_stream(std::istream& in, ParseHandler* p, ParseErrorHandler* e) -> uint32_t
Parse an input stream.

Function documentation

bool is_valid_arcs(const uint32_t value)
#include <dbar.hpp>

Check a parsed value whether it is a valid ARCS (also frame 450 ARCS).

Parameters
value in Value to check for validity
Returns TRUE iff value is valid i.e. was parsed correctly

bool is_valid_confidence(const unsigned value)
#include <dbar.hpp>

Check a parsed value whether it is a valid confidence.

Parameters
value in Value to check for validity
Returns TRUE iff value is valid i.e. was parsed correctly

DBAR load_file(const std::string& filename)
#include <dbar.hpp>

Read an AccurateRip response file to a DBAR object.

Parameters
filename in Name of the file to parse
Returns DBAR object representing the file content

uint32_t parse_file(const std::string& filename, ParseHandler* p, ParseErrorHandler* e)
#include <dbar.hpp>

Parse a file.

Parameters
filename in Name of the file to parse
in Handler for parse events
in Handler for parse errors
Returns Total number of bytes parsed

uint32_t parse_stream(std::istream& in, ParseHandler* p, ParseErrorHandler* e)
#include <dbar.hpp>

Parse an input stream.

Parameters
in in Input stream
in Handler for parse events
in Handler for parse errors
Returns Total number of bytes parsed