pflib v3.14.3-4-g3289bd3
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::utility::intel_hex::Writer Class Reference

writer for the IntelHexFormat More...

#include <intel_hex.h>

Public Member Functions

 Writer (const Writer &)=delete
 
Writer & operator= (const Writer &)=delete
 
 Writer (const std::string &output_filepath)
 
void add (const DataRecord &data)
 
void close ()
 

Private Attributes

FILE * output_file_
 

Detailed Description

writer for the IntelHexFormat

The user is expected to Writer::add records one at a time.

intel_hex::Writer ih_writer("file.hex");
DataRecord record;
for (const auto& [addr, value] : registers) {
// maybe value is a 4 bytes (32 bits)
record.from(addr, value);
}
// file closed when ih_writer is destructed
// or you can call close() manually
a record of data from/to the IntelHex format
Definition intel_hex.h:40
void from(uint16_t addr, WordType value)
set contents of data record using width of integer type
Definition intel_hex.h:52
writer for the IntelHexFormat
Definition intel_hex.h:124

The documentation for this class was generated from the following files: