FileFormatHandlerInterface Class Reference

#include <fileformat_handler.h>

Inheritance diagram for FileFormatHandlerInterface:

Detailed Description

FileFormatHandlerInterface implements a handler for a specific FileFormat. E.g. two different implementations could offer different loaders for one and the same FileFormat. FileFormat::Zip implements one handler for Directory Browsing (IoBrowseRef) and one for ReadArchiveRef.

Public Member Functions

MAXON_METHOD const FileFormat & GetFileFormat () const
 
MAXON_METHOD Result< DataTypeGetHandlerType () const
 
MAXON_METHOD Result< ObjectRef > CreateHandler (const Url &url) const
 
template<typename HANDLER >
MAXON_FUNCTION Result< HANDLER > CreateHandler (const Url &url) const
 
MAXON_METHOD FILEFORMAT_PRIORITY GetDependends () const
 

Private Member Functions

 MAXON_INTERFACE (FileFormatHandlerInterface, MAXON_REFERENCE_CONST, "net.maxon.interface.fileformathandler", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( FileFormatHandlerInterface  ,
MAXON_REFERENCE_CONST  ,
"net.maxon.interface.fileformathandler"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ GetFileFormat()

MAXON_METHOD const FileFormat& GetFileFormat ( ) const

Returns the FileFormat which is handled by this FileFormatHandler.

◆ GetHandlerType()

MAXON_METHOD Result<DataType> GetHandlerType ( ) const

Returns the datatype of the reference class of the handler returned by CreateHandler().

◆ CreateHandler() [1/2]

MAXON_METHOD Result<ObjectRef> CreateHandler ( const Url url) const

Creates an ObjectRef which handles the given url with the generic interface. CreateHandler<InterfaceRef>() can be used to get the expected reference in the right format. E.g. FileFormat::Zip implements one handler for Directory Browsing "IoBrowseRef" and one for working with archives "ReadArchiveRef".

Parameters
[in]urlUrl to be used with this handler.

◆ CreateHandler() [2/2]

MAXON_FUNCTION Result<HANDLER> CreateHandler ( const Url url) const

Creates an ObjectRef which handles the given url with the specific interface. E.g. FileFormat::Zip implements one handler for Directory Browsing "IoBrowseRef" and one for workign with archives "ReadArchiveRef".

Parameters
[in]urlUrl to be used with this handler.
Template Parameters
HANDLERReference class to be expected with the result of CreateHandler.

◆ GetDependends()

MAXON_METHOD FILEFORMAT_PRIORITY GetDependends ( ) const

Returns the dependencies of this FileFormatHandler. This allows to give an priority order for a implementation. This function should not be called except from FileFormatDetectionInterface::DetectAll().