Fletchgen
The Fletcher Design Generator
Public Member Functions | Public Attributes | List of all members
fletchgen::srec::File Struct Reference

Structure to build up an SREC file with multiple Record lines. More...

#include <srec.h>

Public Member Functions

 File (uint32_t start_address, const uint8_t *data, size_t size, const std::string &header_str="HDR")
 Construct a new File from some data source in memory. More...
 
 File (std::istream *input)
 Construct a new File, reading the contents from an input stream. More...
 
void write (std::ostream *output)
 Write the SREC file to an output stream. More...
 
void ToBuffer (uint8_t **buffer, size_t *size)
 Convert an SREC file to a raw buffer. More...
 

Public Attributes

std::vector< Recordrecords
 SREC records in this file.
 

Detailed Description

Structure to build up an SREC file with multiple Record lines.

Definition at line 137 of file srec.h.

Constructor & Destructor Documentation

◆ File() [1/2]

fletchgen::srec::File::File ( uint32_t  start_address,
const uint8_t *  data,
size_t  size,
const std::string &  header_str = "HDR" 
)

Construct a new File from some data source in memory.

Parameters
start_addressThe start address of the file.
dataThe data source.
sizeThe number of bytes of source data.
header_strThe header string. Default is commonly used "HDR".

Definition at line 160 of file srec.cc.

◆ File() [2/2]

fletchgen::srec::File::File ( std::istream *  input)
explicit

Construct a new File, reading the contents from an input stream.

Parameters
inputThe input stream.

Definition at line 192 of file srec.cc.

Member Function Documentation

◆ ToBuffer()

void fletchgen::srec::File::ToBuffer ( uint8_t **  buffer,
size_t *  size 
)

Convert an SREC file to a raw buffer.

Allocates memory that must be freed.

Parameters
bufferA pointer to a pointer that will be set to newly allocated buffer.
sizeThe size of the buffer.

Definition at line 203 of file srec.cc.

◆ write()

void fletchgen::srec::File::write ( std::ostream *  output)

Write the SREC file to an output stream.

Parameters
outputThe output stream to write to.

Definition at line 182 of file srec.cc.


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