denigma 4.0.0
Loading...
Searching...
No Matches
denigma::ConverterRegistry Class Reference

Lightweight registry for locating converters by source and target format. More...

#include <conversion.h>

Public Member Functions

void add (std::unique_ptr< IConverter > converter)
 Adds a converter to the registry.
 
void add (std::unique_ptr< IMultiOutputConverter > converter)
 Adds a multi-output converter to the registry.
 
void add (std::unique_ptr< IReaderConverter > converter)
 Adds a reader-backed converter to the registry.
 
void add (std::unique_ptr< IReaderMultiOutputConverter > converter)
 Adds a reader-backed multi-output converter to the registry.
 
const IConverterfind (FormatId sourceFormat, FormatId targetFormat) const
 Returns the first registered converter matching the requested formats, or nullptr.
 
const IMultiOutputConverterfindMultiOutput (FormatId sourceFormat, FormatId targetFormat) const
 Returns the first registered multi-output converter matching the requested formats, or nullptr.
 
const IReaderConverterfindReader (FormatId sourceFormat, FormatId targetFormat) const
 Returns the first registered reader-backed converter matching the requested formats, or nullptr.
 
const IReaderMultiOutputConverterfindReaderMultiOutput (FormatId sourceFormat, FormatId targetFormat) const
 Returns the first registered reader-backed multi-output converter matching the requested formats, or nullptr.
 
ConversionArtifact convert (FormatId sourceFormat, FormatId targetFormat, std::span< const std::byte > input, const ConversionRequest &request={}) const
 Converts an in-memory input with the registered adapter for the requested formats.
 
ConversionArtifact convert (FormatId sourceFormat, FormatId targetFormat, const IRandomAccessReader &input, const ConversionRequest &request={}) const
 Converts a random-access input with the registered adapter for the requested formats.
 

Detailed Description

Lightweight registry for locating converters by source and target format.

Member Function Documentation

◆ convert() [1/2]

ConversionArtifact denigma::ConverterRegistry::convert ( FormatId  sourceFormat,
FormatId  targetFormat,
const IRandomAccessReader input,
const ConversionRequest request = {} 
) const
inline

Converts a random-access input with the registered adapter for the requested formats.

Returns an error diagnostic when no matching adapter is registered.

◆ convert() [2/2]

ConversionArtifact denigma::ConverterRegistry::convert ( FormatId  sourceFormat,
FormatId  targetFormat,
std::span< const std::byte >  input,
const ConversionRequest request = {} 
) const
inline

Converts an in-memory input with the registered adapter for the requested formats.

Returns an error diagnostic when no matching adapter is registered.


The documentation for this class was generated from the following file: