FileFormatDetectionInterface Class Reference

#include <fileformat_handler.h>

Detailed Description

FileFormatDetectionInterface offers functions to detect file formats.

Public Types

using DetectedCallback = Delegate< Result< Bool >(const Url &url, const FileFormatHandler &handler)>
 

Public Member Functions

template<typename... LIMITTYPES>
Result< BaseArray< FileFormatHandler > > DetectAll (const Url &url, FILEFORMATDETECTIONFLAGS flags, const DetectedCallback &detectedCallback)
 
template<typename... LIMITTYPES>
Result< FileFormatHandler > Detect (const Url &url, FILEFORMATDETECTIONFLAGS flags)
 

Static Public Member Functions

static MAXON_METHOD Result< BaseArray< FileFormatHandler > > DetectAll (const Url &url, const Block< const DataType > &limitDetection, FILEFORMATDETECTIONFLAGS flags, const DetectedCallback &detectedCallback)
 
template<typename... LIMITTYPES>
static MAXON_WARN_UNUSED MAXON_FUNCTION Result< BaseArray< FileFormatHandler > > DetectAll (const Url &url, FILEFORMATDETECTIONFLAGS flags, const DetectedCallback &detectedCallback)
 
template<typename... LIMITTYPES>
static MAXON_WARN_UNUSED MAXON_FUNCTION Result< FileFormatHandler > Detect (const Url &url, FILEFORMATDETECTIONFLAGS flags=FILEFORMATDETECTIONFLAGS::NONE)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (FileFormatDetectionInterface, MAXON_REFERENCE_NONE, "net.maxon.interface.fileformatdetection")
 

Member Typedef Documentation

◆ DetectedCallback

using DetectedCallback = Delegate<Result<Bool>(const Url& url, const FileFormatHandler& handler)>
Returns
The callback should return true if the file format detection should stop at this point. Returning false will search other compatible fileformat handlers. If you return a error the search will be continued. If no valid handler can be found the first error will be returned as the result of DetectAll().

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( FileFormatDetectionInterface  ,
MAXON_REFERENCE_NONE  ,
"net.maxon.interface.fileformatdetection"   
)
private

◆ DetectAll() [1/3]

static MAXON_METHOD Result<BaseArray<FileFormatHandler> > DetectAll ( const Url url,
const Block< const DataType > &  limitDetection,
FILEFORMATDETECTIONFLAGS  flags,
const DetectedCallback detectedCallback 
)
static

Detects all available FileFormatHandler in the order of priority. The first value in the array should be used first.

Parameters
[in]urlUrl to detect.
[in]limitDetectionLimit FileFormatHandler which return the given data types in their CreateHandler() call.
[in]flagssee FILEFORMATDETECTIONFLAGS.
[in]detectedCallbackEvery detected file format handler will call this callback before adding it to the result BaseArray<FileFormatHandler>. For details see DetectedCallback.
Returns
Returns an array with FileFormatHandler which all can handle this url.

◆ DetectAll() [2/3]

static MAXON_WARN_UNUSED MAXON_FUNCTION Result<BaseArray<FileFormatHandler> > DetectAll ( const Url url,
FILEFORMATDETECTIONFLAGS  flags,
const DetectedCallback detectedCallback 
)
static

Detects all available FileFormatHandler in the order of priority. The first value in the array should be used first.

Template Parameters
LIMITTYPESList with reference types to limit the DetectAll call. E.g. DetectAll<MediaLoaderRef>(), DetectAll<MediaLoaderRef, MovieLoaderRef>().
Parameters
[in]urlUrl to detect.
[in]flagssee FILEFORMATDETECTIONFLAGS.
Returns
Returns an array with FileFormatHandler which all can handle this url.

◆ Detect() [1/2]

static MAXON_WARN_UNUSED MAXON_FUNCTION Result<FileFormatHandler> Detect ( const Url url,
FILEFORMATDETECTIONFLAGS  flags = FILEFORMATDETECTIONFLAGS::NONE 
)
static

Detects the first available FileFormatHandler in the order of priority.

Template Parameters
LIMITTYPESList with reference types to limit the DetectAll call. E.g. DetectAll<MediaLoaderRef>(), DetectAll<MediaLoaderRef, MovieLoaderRef>().
Parameters
[in]urlUrl to detect.
[in]flagssee FILEFORMATDETECTIONFLAGS.
Returns
Returns a FileFormatHandler which can handle this url.

◆ DetectAll() [3/3]

Result<BaseArray<FileFormatHandler> > DetectAll ( const Url url,
FILEFORMATDETECTIONFLAGS  flags,
const DetectedCallback detectedCallback 
)

◆ Detect() [2/2]

Result<FileFormatHandler> Detect ( const Url url,
FILEFORMATDETECTIONFLAGS  flags 
)