LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
LIEF::SpanStream Class Reference

#include <SpanStream.hpp>

Inheritance diagram for LIEF::SpanStream:
Collaboration diagram for LIEF::SpanStream:

Public Member Functions

 SpanStream (span< const uint8_t > data)
 
 SpanStream (span< uint8_t > data)
 
 SpanStream (const uint8_t *p, size_t size)
 
 SpanStream (const std::vector< uint8_t > &data)
 
 SpanStream ()=delete
 
 SpanStream (const SpanStream &)=delete
 
SpanStreamoperator= (const SpanStream &)=delete
 
 SpanStream (SpanStream &&other) noexcept=default
 
SpanStreamoperator= (SpanStream &&other) noexcept=default
 
uint64_t size () const override
 
const uint8_t * p () const override
 
const uint8_t * start () const override
 
const uint8_t * end () const override
 
std::vector< uint8_t > content () const
 
result< SpanStreamslice (size_t offset, size_t size) const
 
result< SpanStreamslice (size_t offset) const
 
 ~SpanStream () override=default
 
virtual uint8_t * p ()
 
virtual uint8_t * end ()
 
virtual uint8_t * start ()
 
- Public Member Functions inherited from LIEF::BinaryStream
 BinaryStream (STREAM_TYPE type)
 
virtual ~BinaryStream ()=default
 
STREAM_TYPE type () const
 
result< uint64_t > read_uleb128 () const
 
result< uint64_t > read_sleb128 () const
 
result< int64_t > read_dwarf_encoded (uint8_t encoding) const
 
result< std::string > read_string (size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::string > peek_string (size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::string > peek_string_at (size_t offset, size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::u16string > read_u16string () const
 
result< std::u16string > peek_u16string () const
 
result< std::string > read_mutf8 (size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::u16string > read_u16string (size_t length) const
 
result< std::u16string > peek_u16string (size_t length) const
 
result< std::u16string > peek_u16string_at (size_t offset, size_t length) const
 
virtual ok_error_t peek_data (std::vector< uint8_t > &container, uint64_t offset, uint64_t size)
 
virtual ok_error_t read_data (std::vector< uint8_t > &container, uint64_t size)
 
void setpos (size_t pos) const
 
void increment_pos (size_t value) const
 
void decrement_pos (size_t value) const
 
size_t pos () const
 
 operator bool () const
 
template<class T >
const T * read_array (size_t size) const
 
template<class T >
result< T > peek () const
 
template<class T >
result< T > peek (size_t offset) const
 
template<class T >
const T * peek_array (size_t size) const
 
template<class T >
const T * peek_array (size_t offset, size_t size) const
 
template<class T >
result< T > read () const
 
template<typename T >
bool can_read () const
 
template<typename T >
bool can_read (size_t offset) const
 
size_t align (size_t align_on) const
 
template<class T >
std::enable_if< std::is_integral< T >::value, result< T > >::type peek_conv () const
 
template<class T >
std::enable_if<!std::is_integral< T >::value, result< T > >::type peek_conv () const
 
template<class T >
result< T > peek_conv (size_t offset) const
 
template<class T >
result< T > read_conv () const
 
template<typename T >
std::unique_ptr< T[]> read_conv_array (size_t size) const
 
template<typename T >
std::unique_ptr< T[]> peek_conv_array (size_t offset, size_t size) const
 
void set_endian_swap (bool swap)
 
bool should_swap () const
 

Static Public Member Functions

static result< SpanStreamfrom_vector (const std::vector< uint8_t > &data)
 
template<size_t N>
static result< SpanStreamfrom_array (const std::array< uint8_t, N > &data)
 
static bool classof (const BinaryStream &stream)
 
- Static Public Member Functions inherited from LIEF::BinaryStream
template<typename T >
static T swap_endian (T u)
 
template<class T >
static bool is_all_zero (const T &buffer)
 

Additional Inherited Members

- Public Types inherited from LIEF::BinaryStream
enum class  STREAM_TYPE {
  UNKNOWN = 0 , VECTOR , MEMORY , SPAN ,
  FILE , ELF_DATA_HANDLER
}
 

Constructor & Destructor Documentation

◆ SpanStream() [1/7]

LIEF::SpanStream::SpanStream ( span< const uint8_t > data)
inline

◆ SpanStream() [2/7]

LIEF::SpanStream::SpanStream ( span< uint8_t > data)
inline

◆ SpanStream() [3/7]

LIEF::SpanStream::SpanStream ( const uint8_t * p,
size_t size )
inline

◆ SpanStream() [4/7]

LIEF::SpanStream::SpanStream ( const std::vector< uint8_t > & data)
inline

◆ SpanStream() [5/7]

LIEF::SpanStream::SpanStream ( )
delete

Referenced by from_array(), and from_vector().

◆ SpanStream() [6/7]

LIEF::SpanStream::SpanStream ( const SpanStream & )
delete

◆ SpanStream() [7/7]

LIEF::SpanStream::SpanStream ( SpanStream && other)
defaultnoexcept

◆ ~SpanStream()

LIEF::SpanStream::~SpanStream ( )
overridedefault

References make_error_code(), read_error, and size().

Member Function Documentation

◆ classof()

static bool LIEF::SpanStream::classof ( const BinaryStream & stream)
inlinestatic

◆ content()

std::vector< uint8_t > LIEF::SpanStream::content ( ) const
inline

◆ end() [1/2]

virtual uint8_t * LIEF::BinaryStream::end ( )
inlinevirtual

Reimplemented from LIEF::BinaryStream.

◆ end() [2/2]

const uint8_t * LIEF::SpanStream::end ( ) const
inlineoverridevirtual

Reimplemented from LIEF::BinaryStream.

References size().

◆ from_array()

template<size_t N>
static result< SpanStream > LIEF::SpanStream::from_array ( const std::array< uint8_t, N > & data)
inlinestatic

References SpanStream().

◆ from_vector()

static result< SpanStream > LIEF::SpanStream::from_vector ( const std::vector< uint8_t > & data)
inlinestatic

References SpanStream().

◆ operator=() [1/2]

SpanStream & LIEF::SpanStream::operator= ( const SpanStream & )
delete

◆ operator=() [2/2]

SpanStream & LIEF::SpanStream::operator= ( SpanStream && other)
defaultnoexcept

◆ p() [1/2]

virtual uint8_t * LIEF::BinaryStream::p ( )
inlinevirtual

Reimplemented from LIEF::BinaryStream.

◆ p() [2/2]

const uint8_t * LIEF::SpanStream::p ( ) const
inlineoverridevirtual

Reimplemented from LIEF::BinaryStream.

References LIEF::BinaryStream::pos().

◆ size()

uint64_t LIEF::SpanStream::size ( ) const
inlineoverridevirtual

Implements LIEF::BinaryStream.

Referenced by end(), slice(), and ~SpanStream().

◆ slice() [1/2]

result< SpanStream > LIEF::SpanStream::slice ( size_t offset) const
inline

◆ slice() [2/2]

result< SpanStream > LIEF::SpanStream::slice ( size_t offset,
size_t size ) const
inline

◆ start() [1/2]

virtual uint8_t * LIEF::BinaryStream::start ( )
inlinevirtual

Reimplemented from LIEF::BinaryStream.

◆ start() [2/2]

const uint8_t * LIEF::SpanStream::start ( ) const
inlineoverridevirtual

Reimplemented from LIEF::BinaryStream.


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