![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Discrete, contiguous part of the source's data. More...
#include <DataSource.h>
Inheritance diagram for elftosb::DataSource::Segment:
Collaboration diagram for elftosb::DataSource::Segment:Public Member Functions | |
| Segment (DataSource &source) | |
| Default constructor. | |
| virtual | ~Segment () |
| Destructor. | |
| virtual unsigned | getData (unsigned offset, unsigned maxBytes, uint8_t *buffer)=0 |
| Gets all or a portion of the segment's data. More... | |
| virtual unsigned | getLength ()=0 |
| Gets the length of the segment's data. | |
| virtual bool | hasNaturalLocation ()=0 |
| Returns whether the segment has an associated address. | |
| virtual uint32_t | getBaseAddress () |
| Returns the address associated with the segment. | |
Protected Attributes | |
| DataSource & | m_source |
| The data source to which this segment belongs. | |
Discrete, contiguous part of the source's data.
This class is purely abstract and subclasses of DataSource are expected to subclass it to implement a segment particular to their needs.
|
pure virtual |
Gets all or a portion of the segment's data.
The data is copied into buffer. Up to maxBytes bytes may be copied, so buffer must be at least that large.
| offset | Index of the first byte to start copying from. |
| maxBytes | The maximum number of bytes that can be returned. buffer must be at least this large. |
| buffer | Pointer to buffer where the data is copied. |
Implemented in elftosb::MemoryImageDataSource::TextSegment, elftosb::IVTDataSource, elftosb::UnmappedDataSource, elftosb::ELFSourceFile::ELFDataSource::ProgBitsSegment, and elftosb::DataSource::PatternSegment.