scc 2026.07
SystemC components library
util::ihex Namespace Reference

A utility class for parsing Intel Hex (IHEX) files. More...

Enumerations

enum  { IHEX_DATA_SIZE = 255 }
 The maximum size of data in a single IHEX record. More...

Functions

bool parse (std::istream &, std::function< bool(uint64_t, uint64_t, const uint8_t *)>)
 Parses an IHEX file from the given input stream and invokes a callback function for each data record found.
void dump (std::ostream &os, nonstd::span< uint8_t > const &bytes, uint32_t base_address, uint32_t record_len)

Detailed Description

A utility class for parsing Intel Hex (IHEX) files.

The Intel Hex (IHEX) file format is a common format for representing binary data in a text file. It is widely used in embedded systems and programmable logic devices.

The ihex_parser class provides a method for parsing IHEX files and invoking a callback function for each data record found in the file.

Author
Your Name
Date
YYYY-MM-DD

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The maximum size of data in a single IHEX record.

Definition at line 44 of file ihex.h.

Function Documentation

◆ dump()

void util::ihex::dump ( std::ostream & os,
nonstd::span< uint8_t > const & bytes,
uint32_t base_address,
uint32_t record_len )

Definition at line 190 of file ihex.cpp.

◆ parse()

bool util::ihex::parse ( std::istream & ,
std::function< bool(uint64_t, uint64_t, const uint8_t *)>  )

Parses an IHEX file from the given input stream and invokes a callback function for each data record found.

Parameters
inputThe input stream containing the IHEX file.
callbackA function object that will be invoked for each data record found in the IHEX file. The callback function takes the address, the length and the data as parameter and should return true to continue parsing, or false to stop parsing.
Returns
True if the parsing was successful, false otherwise.

Definition at line 78 of file ihex.cpp.