RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
Linker::WindowWriter Class Reference

Writer subclass that restricts access of another Writer to fixed window. More...

#include <writer.h>

Inheritance diagram for Linker::WindowWriter:
Linker::Writer

Public Member Functions

 WindowWriter (std::shared_ptr< Writer > writer, offset_t start_offset, offset_t maximum_size, offset_t displacement=0)
 
void WriteData (size_t count, const void *data) override
 Write out a sequence of bytes.
 
void Seek (offset_t offset) override
 Jump to a specific location in the ouput stream.
 
void Skip (relative_offset_t offset) override
 Jump to a distance in the output stream.
 
void SeekEnd (relative_offset_t offset=0) override
 Jump to a specific offset from the end.
 
offset_t Tell () override
 Retrieve the current location.
 
- Public Member Functions inherited from Linker::Writer
 Writer (EndianType endiantype)
 
size_t WriteData (size_t max_count, const std::vector< uint8_t > &data, size_t offset=0)
 Write out a sequence of bytes.
 
size_t WriteData (const std::vector< uint8_t > &data, size_t offset=0)
 Write out a sequence of bytes.
 
template<class T , std::size_t N>
void WriteData (const std::array< T, N > &data, size_t offset=0)
 Write out a sequence of bytes.
 
void WriteData (size_t count, std::string text, char padding='\0')
 Write a string, possibly truncated or zero padded.
 
void WriteData (std::string text)
 Write a string.
 
void WriteData (size_t count, std::istream &in)
 Write data using an input stream as the source of data.
 
void WriteWord (size_t bytes, uint64_t value, EndianType endiantype)
 Write a word.
 
void WriteWord (size_t bytes, uint64_t value)
 Write a word.
 
template<typename Clock >
void WriteTimestamp (Timestamp< Clock > timestamp, EndianType endiantype)
 Write a date-time value according to some epoch.
 
template<typename Clock >
void WriteTimestamp (Timestamp< Clock > timestamp)
 Write a date-time value according to some epoch.
 
void FillTo (offset_t position)
 Move to a specific offset, fill with zeroes if needed.
 
void AlignTo (offset_t align)
 Align the current pointer.
 

Public Attributes

std::shared_ptr< Writer > writer
 
offset_t start_offset
 The first offset in the base writer that is accessible, 0 meaning all.
 
offset_t maximum_size
 The maximum number of bytes in the base writer that are accessible, offset_t(-1) is reserved to mean all.
 
offset_t window_offset
 The lowest address that is allowed to be accessed, the offset at which the byte at start_offset is found.
 
- Public Attributes inherited from Linker::Writer
EndianType endiantype
 The default endianness of the binary format, used for reading multibyte numeric data.
 

Protected Member Functions

void _ValidateParameters ()
 
void _ShiftStartOffset (offset_t addend)
 Decrease the window by shifting its lower bound by addend.
 
void _RestrictMaximumSize (offset_t new_maximum)
 Decrease the window by decrementing its upper bound.
 
void _AddDisplacement (offset_t displacement)
 Shift the address values at which the window is accessed, so the previous offset O is accessed at O + extra_displacement.
 

Static Protected Member Functions

static std::shared_ptr< Writer > _GetWriter (std::shared_ptr< Writer > writer)
 
static offset_t _GetStartOffset (std::shared_ptr< Writer > writer)
 
static offset_t _GetMaximumSize (std::shared_ptr< Writer > writer)
 
static offset_t _GetWindowOffset (std::shared_ptr< Writer > writer)
 

Detailed Description

Writer subclass that restricts access of another Writer to fixed window.

Member Function Documentation

◆ Seek()

void WindowWriter::Seek ( offset_t  offset)
overridevirtual

Jump to a specific location in the ouput stream.

Implements Linker::Writer.

◆ SeekEnd()

void WindowWriter::SeekEnd ( relative_offset_t  offset = 0)
overridevirtual

Jump to a specific offset from the end.

Implements Linker::Writer.

◆ Skip()

void WindowWriter::Skip ( relative_offset_t  offset)
overridevirtual

Jump to a distance in the output stream.

Implements Linker::Writer.

◆ Tell()

offset_t WindowWriter::Tell ( )
overridevirtual

Retrieve the current location.

Implements Linker::Writer.

◆ WriteData()

void WindowWriter::WriteData ( size_t  count,
const void *  data 
)
overridevirtual

Write out a sequence of bytes.

Implements Linker::Writer.


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