![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Intel Hex parser. More...
#include <StIntelHexFile.h>
Collaboration diagram for StIntelHexFile:Classes | |
| struct | IntelHex |
Public Types | |
| typedef std::vector< IntelHex >::const_iterator | const_iterator |
| Iterator type. | |
Public Member Functions | |
| StIntelHexFile (std::istream &inStream) | |
| Constructor. | |
| virtual | ~StIntelHexFile () |
| Destructor. More... | |
File name | |
| virtual void | setName (const std::string &inName) |
| virtual std::string | getName () const |
Parsing | |
| virtual bool | isIntelHexFile () |
| Determine if the file is a Intel Hex file. More... | |
| virtual void | parse () |
| Parse the entire IntelHex input stream. More... | |
Record access | |
| unsigned | getRecordCount () const |
| const_iterator | getBegin () const |
| const_iterator | getEnd () const |
Operators | |
| const IntelHex & | operator[] (unsigned inIndex) |
Protected Member Functions | |
Parsing utilities | |
| virtual void | parseLine (std::string &inLine) |
| Parses individual Intel Hex. More... | |
| bool | isHexDigit (char c) |
| int | hexDigitToInt (char digit) |
| int | readHexByte (std::string &inString, int inIndex) |
Protected Attributes | |
| std::istream & | m_stream |
| The input stream for the Intel Hex data. | |
| std::vector< IntelHex > | m_records |
| Vector of Intel Hex in the input data. | |
| std::string | m_name |
| File name. (optional) | |
Intel Hex parser.
This class takes an input stream and parses it as a Intel Hex file. While the individual records that comprise the file are available for access, the class also provides a higher-level view of the contents. It processes the individual records and builds an image of what the memory touched by the file looks like. Then you can access the contiguous sections of memory.
| struct StIntelHexFile::IntelHex |
Structure representing each individual line of the Intel Hex input data.
|
virtual |
Destructor.
Frees any data allocated as part of an Intel Hex.
|
inline |
|
inline |
|
virtual |
Determine if the file is a Intel Hex file.
Just looks for ":" as the first characters of the file followed by two digit characters.
|
virtual |
Parse the entire IntelHex input stream.
Extract records one line at a time and hand them to the parseLine() method. Either CR, LF, or CRLF line endings are supported. The input stream is read until EOF or an file end record detected. The parse() method must be called after the object has been constructed before any of the records will become accessible.
| StIntelHexParseException | will be thrown if any error occurs while parsing the input. |
|
protectedvirtual |
Parses individual Intel Hex.
Takes a single Intel Hex line as input and appends a new IntelHex struct to the m_records vector.
| StIntelHexParseException | will be thrown if any error occurs while parsing inLine. |
|
protected |
| StIntelHexParseException | is thrown if either of the nibble characters is not a valid hex digit. |