xxxsrAutoDet()
This function analyzes the source document and determines whether the detected file format requires the custom reader. It is called only when the [CustomFilters] section of the formats.ini file contains an entry identifying the complete file name of the custom reader. For more information on the formats.ini file, see Obtain Format Information.
Syntax
Bool pascal _export xxxsrAutoDet( adTPDocInfo *pTPDocInfo, KPTPIOobj *pIO)
Arguments
pTPDocInfo
|
A pointer to the adTPDocInfo structure provided by the structured access layer. |
pIO
|
A pointer to the I/O stream object for the document processed. |
Returns
TRUEif the file format matches that of the custom reader.FALSEif the file format does not match that of the custom reader.
Discussion
-
Typically, only the first 1 KB of the file is read into a buffer and analyzed to determine if it matches the file format of the custom reader. If a match is determined, the following four members of the
adTPDocInfostructure must be assigned before returningTRUE:adClassMust be set to 1.adFormatA numerical value assigned to this reader in the [Formats]section of theformats.inifile.descStrA string describing the file format. mMnmemStrThe initial part of the custom reader file name with the " sr" excluded.
- If the return value is
TRUE, the custom reader is used to parse the file and generate the token stream. - If the return value is
FALSE, all other readers in the[CustomFilters]section of theformats.inifile are tried. If no match is found, the file detection process continues checking for the formats supported by Filter SDK. - The entry in the
[Formats]section of theformats.inifile should be of the formaaa.bbb.ccc.ddd, whereaaais the value used for theadFormatparameter,bbbis the value of the file class,cccis the value of the minor format, anddddis the value of the major version.