Base Framework
Public Types | Public Member Functions | List of all members
MemoryDump Class Reference

Memory dump descriptor. More...

#include <base/mem/MemoryDump.h>

Inherits Object.

Public Types

enum  Option {
  HEADER = 1, REPEAT_HEADER = 2, ADDRESS = 4, OFFSET = 8,
  CHARS = 16
}
 

Public Member Functions

 MemoryDump (const uint8 *memory, unsigned int size, unsigned int options=HEADER|REPEAT_HEADER|OFFSET|CHARS) noexcept
 
void setWordSize (unsigned int value)
 
void setOffsetDigits (unsigned int digits)
 
void setGlobalOffset (uint64 offset)
 

Detailed Description

Memory dump descriptor.

This class describes a block of memory to be dumped to a format output stream.

Version
1.0
Examples
testsuite/IEEE1394.cpp.

Member Enumeration Documentation

◆ Option

Enumerator
HEADER 

Enables the header.

REPEAT_HEADER 

Enables repeat of header every 16 rows.

ADDRESS 

Enables output of address.

OFFSET 

Enables output of offset.

CHARS 

Enable character output.

Constructor & Destructor Documentation

◆ MemoryDump()

MemoryDump::MemoryDump ( const uint8 *  memory,
unsigned int  size,
unsigned int  options = HEADER|REPEAT_HEADER|OFFSET|CHARS 
)
inlinenoexcept

Initializes the descriptor with a word size of 1 and the global offset equal to 0.

Parameters
memoryThe address of the memory to dump.
sizeThe size of the memory block in bytes.
optionsThe options. Header, repeat of header, offset, and characters are enabled by default.

Member Function Documentation

◆ setGlobalOffset()

void MemoryDump::setGlobalOffset ( uint64  offset)
inline

Sets the global offset.

◆ setOffsetDigits()

void MemoryDump::setOffsetDigits ( unsigned int  digits)
inline

Sets the global offset.

◆ setWordSize()

void MemoryDump::setWordSize ( unsigned int  value)
inline

Sets the word size (1, 2, 4, or 8).