The tcDspParseIHex class is a parser that works on Intel HEX files. When the class is constructed (or a ResetParser command is given) an output buffer is created or provided. Data is added to the parser via the AddData method. Data does not have to be aligned in any way. Any unconsumed data is preserved between calls to AddData.
Whenever a file is complete, or an error occurs, a user-provided callback (registered via the RegisterCallback method) is activated. The status and buffer location and maximum offset is provided. Also, a 32-bit checksum is provided for validation. This checksum is the summation of all line-by-line checksums seen in the file.
When an error occurs, the user callback may direct the parser to continue or reset, based upon the boolean returned.
This is a simple example of tcDspParseIHex creation and usage: