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 File Format Detection.
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
TRUE
if the file format matches that of the custom reader.FALSE
if 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
adTPDocInfo
structure must be assigned before returningTRUE
:adClass
Must be set to 1
.adFormat
A numerical value assigned to this reader in the [Formats]
section of theformats.ini
file.descStr
A string describing the file format. mMnmemStr
The 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.ini
file 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.ini
file should be of the formaaa.bbb.ccc.ddd
, whereaaa
is the value used for theadFormat
parameter,bbb
is the value of the file class,ccc
is the value of the minor format, andddd
is the value of the major version.