File Type ManagerVersion: 1.0


Callback function that identifies a FileType by reading into it.

    bool FileTypeInspectorCallBack (
      IChannel&  ic,
      void*      retVal


Input channel to be inspected.
Implementation specific return value. Must be checked for NULL.

Return Values

Value Meaning
true The input channel is identified as the given FileType.
false The input channel is not identified.


This 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;


Version: Input-Output Library 1.0.0 or later
Header: FileTypeManager.hpp
Import Library: InputOutput.lib [WIN]
Module: InputOutputLib [MAC], InputOutput.dll [WIN]

See Also

File Type Manager, FileType::FileType, FileTypeManager::Identify