FileFormatDetectionCacheInterface Class Reference

#include <fileformat_detectioncache.h>

Inheritance diagram for FileFormatDetectionCacheInterface:

Detailed Description

This interface allows to detect files with a file cache to prevent frequently open file io operations. Used together with DragAndDropHandlerInterface to optimize d&d. e.g. FileFormatDetectionCacheRef fileFormatCacheRef = dndHandlerRef.GetFileDetectionCache() iferr_return; ifnoerr (isTrue = fileFormatCacheRef.DetectFile<MediaInputRef>(url, FILEFORMATDETECTIONFLAGS::NONE)) { if (isTrue) { isMediaSessionUrl |= isTrue; break; } } ifnoerr (isTrue = fileFormatCacheRef.DetectFile<nodes::NodeSystem>(url, FILEFORMATDETECTIONFLAGS::NONE)) { if (isTrue) { isNodeAsset |= isTrue; break; } }

Public Member Functions

MAXON_METHOD Result< BoolDetectFile (const Url &url, FILEFORMATDETECTIONFLAGS flags, const Block< const DataType > &limitDetection)
 
template<typename... LIMITTYPES>
MAXON_WARN_UNUSED MAXON_FUNCTION Result< BoolDetectFile (const Url &url, FILEFORMATDETECTIONFLAGS flags)
 
template<typename... LIMITTYPES>
Result< BoolDetectFile (const Url &url, FILEFORMATDETECTIONFLAGS flags)
 

Private Member Functions

 MAXON_INTERFACE (FileFormatDetectionCacheInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.fileformatdetectioncacheinterface")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( FileFormatDetectionCacheInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.fileformatdetectioncacheinterface"   
)
private

◆ DetectFile() [1/3]

MAXON_METHOD Result<Bool> DetectFile ( const Url url,
FILEFORMATDETECTIONFLAGS  flags,
const Block< const DataType > &  limitDetection 
)

Checks if a file supports a given file format.

Parameters
[in]urlUrl to detect.
[in]flagssee FILEFORMATDETECTIONFLAGS.
[in]limitDetectionDatatype to limit the detection e.g. MediaInputRef, nodes::NodeSystem
Returns
OK on success.

◆ DetectFile() [2/3]

MAXON_WARN_UNUSED MAXON_FUNCTION Result<Bool> DetectFile ( const Url url,
FILEFORMATDETECTIONFLAGS  flags 
)

Checks if a file supports a given file format. Helper function to simplify usage e.g. DetectFile<MediaInputRef>().

Parameters
[in]urlUrl to detect.
[in]flagssee FILEFORMATDETECTIONFLAGS.
Returns
OK on success.

◆ DetectFile() [3/3]

Result<Bool> DetectFile ( const Url url,
FILEFORMATDETECTIONFLAGS  flags 
)