![]() |
File Type ManagerVersion: 1.0 | ||||||
FileTypeInspectorCallBackCallback function that identifies a FileType by reading into it. bool FileTypeInspectorCallBack (
IChannel& ic,
void* retVal
);
Parameters
Return Values
RemarksThis callback function is used by FileTypeManager when concurrent file extensions must be resolved and it is only possible by inspecting the content of file. This callback function should be supplied for every FileType object in FileType::FileType that is entered into FileTypeManger, but it is not mandatory. If the callback function is not supplied than false is assumed as return value. The input channel is always set to position 0 before the FileTypeManager calls this function. The retVal is a pointer to an implementation specific data structure, that will be returned by FileTypeManager::Identify. It must be checked for NULL before usage. It can be used for any purpose, such as identification of subtype of the file. The following example identifies a Windows bitmap file. bool BMPTypeCallback(IChannel& ic, void* /*retVal*/)
{
char buffer[2];
if (ic.ReadBin (buffer, 2) != NoError)
return false;
if (buffer[0] == 'B' && buffer[1] == 'M')
return true;
return false;
}
Requirements
See AlsoFile Type Manager, FileType::FileType, FileTypeManager::Identify |
|||||||
|
Copyright © 2006 - Graphisoft R&D Zrt. All rights reserved worldwide. Built on Aug 15, 2001 |