Important: The information in this document is obsolete and should not be used for new development.
DoIdentifyFile
A file translation extension must respond to thekTranslateIdentifyFile
request code. The Translation Manager uses this request code to allow the translation extension to identify a file as having a format that the extension can translate. You can handle this request by calling theCallComponentFunctionWithStorage
function and passing it a pointer to a function with the syntax defined by theDoIdentifyFile
function.
FUNCTION DoIdentifyFile (self: ComponentInstance; theDoc: FSSpec; VAR docKind: FileType) : ComponentResult;
self
- A component instance that identifies the component containing the translation extension.
theDoc
- A file system specification record that specifies the document that the translation extension must identify.
docKind
- On exit, the file format type of the document as identified by your translation extension.
DESCRIPTION
YourDoIdentifyFile
function returns, through thedocKind
parameter, the file type of the file specified by theFSSpec
record passed in thetheDoc
parameter. If your translation extension does not recognize the type of the specified file,DoIdentifyFile
should return the result codenoTypeErr
.SPECIAL CONSIDERATIONS
YourDoIdentifyFile
function should not return'TEXT'
as a file type unless you determine that the document consists solely of a plain, unformatted stream of ASCII characters.RESULT CODES
noErr 0 No error noTypeErr -102 Unrecognized file type