#include <fileformat_detectioncache.h>
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< Bool > | DetectFile (const Url &url, FILEFORMATDETECTIONFLAGS flags, const Block< const DataType > &limitDetection) |
template<typename... LIMITTYPES> | |
MAXON_WARN_UNUSED MAXON_FUNCTION Result< Bool > | DetectFile (const Url &url, FILEFORMATDETECTIONFLAGS flags) |
template<typename... LIMITTYPES> | |
Result< Bool > | DetectFile (const Url &url, FILEFORMATDETECTIONFLAGS flags) |
Private Member Functions | |
MAXON_INTERFACE (FileFormatDetectionCacheInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.fileformatdetectioncacheinterface", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")) | |
|
private |
MAXON_METHOD Result<Bool> DetectFile | ( | const Url & | url, |
FILEFORMATDETECTIONFLAGS | flags, | ||
const Block< const DataType > & | limitDetection | ||
) |
Checks if a file supports a given file format.
[in] | url | Url to detect. |
[in] | flags | see FILEFORMATDETECTIONFLAGS. |
[in] | limitDetection | Datatype to limit the detection e.g. MediaInputRef, nodes::NodeSystem |
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>().
[in] | url | Url to detect. |
[in] | flags | see FILEFORMATDETECTIONFLAGS. |
Result<Bool> DetectFile | ( | const Url & | url, |
FILEFORMATDETECTIONFLAGS | flags | ||
) |