libopenraw  0.3.7
Public Types | Public Member Functions | List of all members
OpenRaw::Internals::MRW::DataBlock Class Reference

Represents an MRW Data Block. More...

#include <mrwcontainer.hpp>

Public Types

typedef std::shared_ptr< DataBlockRef
 

Public Member Functions

 DataBlock (off_t start, MRWContainer *container)
 
off_t offset () const
 
off_t length () const
 
std::string name () const
 
Option< uint8_t > uint8_val (off_t offset) const
 
Option< uint16_t > uint16_val (off_t offset) const
 
Option< std::string > string_val (off_t offset) const
 
bool loaded () const
 

Detailed Description

Represents an MRW Data Block.

Definition at line 48 of file mrwcontainer.hpp.

Member Typedef Documentation

◆ Ref

Shared pointer to DataBlock

Definition at line 51 of file mrwcontainer.hpp.

Constructor & Destructor Documentation

◆ DataBlock()

OpenRaw::Internals::MRW::DataBlock::DataBlock ( off_t  start,
MRWContainer container 
)

Construct a datablock from a location in the container

Parameters
startthe begin address relative to the container.
containerthe container containing the data block.

Definition at line 37 of file mrwcontainer.cpp.

References OpenRaw::Internals::RawContainer::fetchData(), name(), and OpenRaw::Internals::RawContainer::readInt32().

Member Function Documentation

◆ length()

off_t OpenRaw::Internals::MRW::DataBlock::length ( ) const
inline

Return the length of the data block, excluding the block header.

Definition at line 65 of file mrwcontainer.hpp.

◆ loaded()

bool OpenRaw::Internals::MRW::DataBlock::loaded ( ) const
inline

Return if the data block was loaded.

Definition at line 91 of file mrwcontainer.hpp.

◆ name()

std::string OpenRaw::Internals::MRW::DataBlock::name ( ) const
inline

Return the name of the data block.

Definition at line 69 of file mrwcontainer.hpp.

Referenced by DataBlock().

◆ offset()

off_t OpenRaw::Internals::MRW::DataBlock::offset ( ) const
inline

Return the offset of the data block from the begining of its container.

Definition at line 61 of file mrwcontainer.hpp.

◆ string_val()

Option< std::string > OpenRaw::Internals::MRW::DataBlock::string_val ( off_t  offset) const

Return a string value at offset bytes fro the start of the data block

Definition at line 76 of file mrwcontainer.cpp.

References OpenRaw::Internals::RawContainer::fetchData().

◆ uint16_val()

Option< uint16_t > OpenRaw::Internals::MRW::DataBlock::uint16_val ( off_t  offset) const

Return an unsigned 16-bit quantity at offset bytes from the start of the data block.

Definition at line 68 of file mrwcontainer.cpp.

References OpenRaw::Internals::RawContainer::readUInt16().

◆ uint8_val()

Option< uint8_t > OpenRaw::Internals::MRW::DataBlock::uint8_val ( off_t  offset) const

Return an unsigned 8-bit quantity at offset bytes from the start of the data block.

Definition at line 60 of file mrwcontainer.cpp.


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