FileFormatInterface Class Reference

#include <fileformat.h>

Inheritance diagram for FileFormatInterface:

Detailed Description

FileFormatInterface allows to implement and register file formats with its detection algorithm. The FileFormats registry allows to register any format (e.g. FileFormats::Browsable, FileFormats::ImageJpg...).

Public Member Functions

MAXON_METHOD Result< BoolDetect (const Url &url, const InputStreamRef &probeStream, FILEFORMATDETECTIONFLAGS flags) const
 

Private Member Functions

 MAXON_INTERFACE (FileFormatInterface, MAXON_REFERENCE_CONST, "net.maxon.interface.fileformat", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 
Result< void > SetData (ForwardingDataPtr &&key, Data &&data)=delete
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( FileFormatInterface  ,
MAXON_REFERENCE_CONST  ,
"net.maxon.interface.fileformat"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ SetData()

Result<void> SetData ( ForwardingDataPtr &&  key,
Data &&  data 
)
privatedelete

◆ Detect()

MAXON_METHOD Result<Bool> Detect ( const Url url,
const InputStreamRef &  probeStream,
FILEFORMATDETECTIONFLAGS  flags 
) const

For implementations to check if a given url/stream supports this file format. You should never call this function directly. It's triggered by FileFormatDetectionInterface::Detect()/DetectAll().

Parameters
[in]urlUrl to check.
[in]probeStreamOptional parameter that allows to read content in case that the url is a file. This stream is not a plain file stream but wraps a memory cache stream which allows to seek and read already loaded data without overhead.
[in]flagssee FILEFORMATDETECTIONFLAGS.
Returns
Returns true if the url/stream fits to this file format implementation.