blfwk::ELFSourceFile::ELFDataSource::ProgBitsSegment Class Reference

Represents one named #SHT_PROGBITS section within the ELF file. More...

`#include <ELFSourceFile.h>`

Inheritance diagram for blfwk::ELFSourceFile::ELFDataSource::ProgBitsSegment:
[legend]
Collaboration diagram for blfwk::ELFSourceFile::ELFDataSource::ProgBitsSegment:
[legend]

## Public Member Functions

| ProgBitsSegment (ELFDataSource &source, StELFFile *elf, unsigned index)
virtual unsigned | getData (unsigned offset, unsigned maxBytes, uint8_t *buffer)
| Gets all or a portion of the segment's data. More...
virtual unsigned | getLength ()
| Gets the length of the segment's data.
virtual bool | hasNaturalLocation ()
| Returns whether the segment has an associated address.
virtual uint32_t | getBaseAddress ()
| Returns the address associated with the segment.
Public Member Functions inherited from blfwk::DataSource::Segment
| Segment (DataSource &source)
| Default constructor.
virtual | ~Segment ()
| Destructor.

## Protected Attributes

StELFFile * | m_elf
| The format parser instance for this ELF file.
unsigned | m_sectionIndex
| The index of the section this segment represents.
Protected Attributes inherited from blfwk::DataSource::Segment
DataSource & | m_source
| The data source to which this segment belongs.

## Detailed Description

Represents one named #SHT_PROGBITS section within the ELF file.

## Member Function Documentation

unsigned ELFSourceFile::ELFDataSource::ProgBitsSegment::getData | ( | unsigned | offset,
|  | unsigned | maxBytes,
|  | uint8_t * | buffer
| ) |  |

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.

Parameters

  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.

Returns
  The number of bytes copied into buffer.

Implements blfwk::DataSource::Segment.

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

- src/blfwk/ELFSourceFile.h
- src/blfwk/src/ELFSourceFile.cpp