arcsdec::v_1_0_0::Matcher class

Interface for matchers.

A Matcher is a check for a certain file format or audio codec.

Derived classes

template<enum Format F>
class v_1_0_0::FormatMatcher final
Matcher for file formats.

Constructors, destructors, conversion operators

~Matcher() virtual noexcept
Virtual default destructor.

Public functions

auto clone() const -> std::unique_ptr<Matcher>
Create a deep copy.
auto codecs() const -> std::set<Codec>
Codecs supported by this matcher.
auto format() const -> Format
Format matched by this matcher.
auto matches(const Bytes& bytes) const -> bool
Match byte sequence located at a specific offset in the file.
auto matches(const std::string& filename) const -> bool
Match filename.
auto name() const -> std::string
Name of this matcher.
auto reference_bytes() const -> Bytes
Reference bytes to be matched.

Function documentation

std::unique_ptr<Matcher> arcsdec::v_1_0_0::Matcher::clone() const

Create a deep copy.

Returns Deep copy of this instance.

std::set<Codec> arcsdec::v_1_0_0::Matcher::codecs() const

Codecs supported by this matcher.

Returns Codecs supported by this matcher

Format arcsdec::v_1_0_0::Matcher::format() const

Format matched by this matcher.

Returns Format matched by this matcher.

bool arcsdec::v_1_0_0::Matcher::matches(const Bytes& bytes) const

Match byte sequence located at a specific offset in the file.

Parameters
bytes in Bytes of a file to check.
Returns TRUE if bytes occur in the target

bool arcsdec::v_1_0_0::Matcher::matches(const std::string& filename) const

Match filename.

Parameters
filename in Name of the file to check.
Returns TRUE if filename matches what is described by this instance

std::string arcsdec::v_1_0_0::Matcher::name() const

Name of this matcher.

Returns Name of this matcher.

A printable name that hints about what this matcher refers to.

Bytes arcsdec::v_1_0_0::Matcher::reference_bytes() const

Reference bytes to be matched.

Returns Reference bytes this matcher tries to match.