![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
S-record parser. More...
#include <StSRecordFile.h>
Collaboration diagram for StSRecordFile:Classes | |
| struct | SRecord |
Public Types | |
| typedef std::vector< SRecord >::const_iterator | const_iterator |
| Iterator type. | |
| typedef std::vector< SRecord >::const_iterator | const_iterator |
| Iterator type. | |
Public Member Functions | |
| StSRecordFile (std::istream &inStream) | |
| Constructor. | |
| virtual | ~StSRecordFile () |
| Destructor. More... | |
| StSRecordFile (std::istream &inStream) | |
| Constructor. | |
| virtual | ~StSRecordFile () |
| Destructor. | |
File name | |
| virtual void | setName (const std::string &inName) |
| virtual std::string | getName () const |
| virtual void | setName (const std::string &inName) |
| virtual std::string | getName () const |
Parsing | |
| virtual bool | isSRecordFile () |
| Determine if the file is an S-record file. More... | |
| virtual void | parse () |
| Parses the entire S-record input stream. More... | |
| virtual bool | isSRecordFile () |
| Determine if the file is an S-record file. | |
| virtual void | parse () |
| Parses the entire S-record input stream. | |
Record access | |
| unsigned | getRecordCount () const |
| const_iterator | getBegin () const |
| const_iterator | getEnd () const |
| unsigned | getRecordCount () const |
| const_iterator | getBegin () const |
| const_iterator | getEnd () const |
Operators | |
| const SRecord & | operator[] (unsigned inIndex) |
| const SRecord & | operator[] (unsigned inIndex) |
Protected Member Functions | |
Parsing utilities | |
| virtual void | parseLine (std::string &inLine) |
| Parses individual S-records. More... | |
| bool | isHexDigit (char c) |
| int | hexDigitToInt (char digit) |
| int | readHexByte (std::string &inString, int inIndex) |
| virtual void | parseLine (std::string &inLine) |
| 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 S-record data. | |
| std::vector< SRecord > | m_records |
| Vector of S-records in the input data. | |
| std::string | m_name |
| File name. (optional) | |
S-record parser.
This class takes an input stream and parses it as an S-record 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 StSRecordFile::SRecord |
Structure representing each individual line of the S-record input data.
|
virtual |
Destructor.
Frees any data allocated as part of an S-record.
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
Determine if the file is an S-record file.
Just looks for "S[0-9]" as the first two characters of the file.
|
virtual |
Parses the entire S-record 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. The parse() method must be called after the object has been constructed before any of the records will become accessible.
| StSRecordParseException | will be thrown if any error occurs while parsing the input. |
|
protectedvirtual |
Parses individual S-records.
Takes a single S-record line as input and appends a new SRecord struct to the m_records vector.
| StSRecordParseException | will be thrown if any error occurs while parsing inLine. |
|
protected |
| StSRecordParseException | is thrown if either of the nibble characters is not a valid hex digit. |