retdec
Public Member Functions | Private Attributes | List of all members
retdec::fileformat::BlobStream Class Reference

#include <blob_stream.h>

Inheritance diagram for retdec::fileformat::BlobStream:
Inheritance graph
[legend]
Collaboration diagram for retdec::fileformat::BlobStream:
Collaboration graph
[legend]

Public Member Functions

 BlobStream (std::uint64_t streamOffset, std::uint64_t streamSize)
 
Getters
std::vector< std::uint8_t > getElement (std::size_t offset) const
 
Element methods
void addElement (std::size_t offset, const std::vector< std::uint8_t > &data)
 
- Public Member Functions inherited from retdec::fileformat::Stream
virtual ~Stream ()=default
 
StreamType getType () const
 
std::uint64_t getOffset () const
 
std::uint64_t getSize () const
 
const std::string & getName () const
 

Private Attributes

std::unordered_map< std::size_t, std::vector< std::uint8_t > > elements
 

Additional Inherited Members

- Protected Member Functions inherited from retdec::fileformat::Stream
 Stream (StreamType streamType, std::uint64_t streamOffset, std::uint64_t streamSize)
 

Constructor & Destructor Documentation

◆ BlobStream()

retdec::fileformat::BlobStream::BlobStream ( std::uint64_t  streamOffset,
std::uint64_t  streamSize 
)

Constructor.

Parameters
streamOffsetStream offset.
streamSizeStream size.

Member Function Documentation

◆ addElement()

void retdec::fileformat::BlobStream::addElement ( std::size_t  offset,
const std::vector< std::uint8_t > &  data 
)

Adds new element at the specified offset.

Parameters
offsetOffset of the element.
dataData of the element.

◆ getElement()

std::vector< std::uint8_t > retdec::fileformat::BlobStream::getElement ( std::size_t  offset) const

Returns the element at the specified offset in the blob.

Parameters
offsetOffset of the element.
Returns
Element data if it exists, otherwise empty sequence.

Member Data Documentation

◆ elements

std::unordered_map<std::size_t, std::vector<std::uint8_t> > retdec::fileformat::BlobStream::elements
private

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