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 File Format Detection.
Bool pascal _export xxxsrAutoDet( adTPDocInfo *pTPDocInfo, KPTPIOobj *pIO)
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. |
TRUE
if the file format matches that of the custom reader.FALSE
if the file format does not match that of the custom reader.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 adTPDocInfo
structure must be assigned before returning TRUE
:
adClass
|
Must be set to 1 . |
adFormat
|
A numerical value assigned to this reader in the [Formats] section of the formats.ini file. |
descStr
|
A string describing the file format. |
mMnmemStr
|
The initial part of the custom reader file name with the "sr " excluded. |
TRUE
, the custom reader is used to parse the file and generate the token stream.FALSE
, all other readers in the [CustomFilters]
section of the formats.ini
file are tried. If no match is found, the file detection process continues checking for the formats supported by Filter SDK.[Formats]
section of the formats.ini
file should be of the form aaa.bbb.ccc.ddd
, where aaa
is the value used for the adFormat
parameter, bbb
is the value of the file class, ccc
is the value of the minor format, and ddd
is the value of the major version.
|