RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
A buffer that can be used to read and store data from a file. More...
#include <buffer.h>
Public Member Functions | |
Buffer (size_t size) | |
offset_t | ImageSize () const override |
Retrieves size of stored data. | |
void | ReadFile (Reader &rd) |
void | ReadFile (Reader &rd, offset_t count) |
offset_t | WriteFile (Writer &wr, offset_t count, offset_t offset=0) const override |
Writes data of non-zero filled sections. | |
size_t | ReadData (size_t bytes, offset_t offset, void *buffer) const override |
Attempts to fill a buffer with data. | |
virtual offset_t | WriteFile (Writer &wr, offset_t count, offset_t offset=0) const=0 |
Writes data of non-zero filled sections. | |
virtual offset_t | WriteFile (Writer &wr) const |
Writes data of non-zero filled sections. | |
![]() | |
std::shared_ptr< const ActualImage > | AsImage () const override |
Retrieves a randomly accessible image. | |
uint64_t | ReadUnsigned (size_t bytes, offset_t offset, EndianType endiantype) const |
Reads an unsigned number at a specific offset. | |
uint64_t | ReadUnsigned (size_t bytes, offset_t offset) const |
Reads an unsigned number at a specific offset with the default endianness. | |
int64_t | ReadSigned (size_t bytes, offset_t offset, EndianType endiantype) const |
Reads a signed number at a specific offset. | |
int64_t | ReadSigned (size_t bytes, offset_t offset) const |
Reads a signed number at a specific offset with the default endianness. | |
int | GetByte (offset_t offset) const |
Retrieve byte at a certain offset (optional, might not be defined) | |
![]() | |
std::shared_ptr< ActualImage > | AsImage () |
Retrieves a randomly accessible image. | |
Static Public Member Functions | |
static std::shared_ptr< Buffer > | ReadFromFile (Reader &rd) |
static std::shared_ptr< Buffer > | ReadFromFile (Reader &rd, offset_t count) |
Protected Attributes | |
std::vector< uint8_t > | data |
Friends | |
class | Section |
class | Image |
A buffer that can be used to read and store data from a file.
|
overridevirtual |
Retrieves size of stored data.
Implements Linker::Image.
|
overridevirtual |
Attempts to fill a buffer with data.
bytes | The (maximum) number of bytes to place in buffer |
offset | The offset in the image to start reading the data |
buffer | A byte buffer |
Implements Linker::ActualImage.
Reimplemented in Linker::Section.
|
virtual |
Writes data of non-zero filled sections.
Reimplemented from Linker::Image.
Reimplemented in Linker::Section.
|
overridevirtual |
Writes data of non-zero filled sections.
Implements Linker::Image.
Reimplemented in Linker::Section, and Linker::Section.
|
virtual |
Writes data of non-zero filled sections.
Implements Linker::Image.
Reimplemented in Linker::Section, and Linker::Section.