KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PADS_IO::SDB_RECORD Class Reference

A bounds-checked reader positioned at one record inside a buffer. More...

#include <pads_binary_utils.h>

Public Member Functions

 SDB_RECORD (const BINARY_CURSOR &aCursor, size_t aBase)
 
uint8_t U8 (size_t aOffset) const
 
uint16_t U16 (size_t aOffset) const
 
uint32_t U32 (size_t aOffset) const
 
int32_t I32 (size_t aOffset) const
 
double F64 (size_t aOffset) const
 
std::string Str (size_t aOffset, size_t aMaxLen) const
 
size_t Base () const
 

Private Attributes

const BINARY_CURSORm_cursor
 
size_t m_base
 

Detailed Description

A bounds-checked reader positioned at one record inside a buffer.

Field reads are by offset relative to the record base, so a reader can express its record layout with named field constants instead of absolute file offsets.

Holds a reference to the owning cursor; it is a transient view and must not outlive the buffer the cursor binds.

Definition at line 312 of file pads_binary_utils.h.

Constructor & Destructor Documentation

◆ SDB_RECORD()

PADS_IO::SDB_RECORD::SDB_RECORD ( const BINARY_CURSOR & aCursor,
size_t aBase )
inline

Definition at line 315 of file pads_binary_utils.h.

References m_base, and m_cursor.

Member Function Documentation

◆ Base()

size_t PADS_IO::SDB_RECORD::Base ( ) const
inline

Definition at line 329 of file pads_binary_utils.h.

References m_base.

◆ F64()

double PADS_IO::SDB_RECORD::F64 ( size_t aOffset) const
inline

Definition at line 323 of file pads_binary_utils.h.

References m_base, and m_cursor.

◆ I32()

◆ Str()

◆ U16()

uint16_t PADS_IO::SDB_RECORD::U16 ( size_t aOffset) const
inline

◆ U32()

◆ U8()

uint8_t PADS_IO::SDB_RECORD::U8 ( size_t aOffset) const
inline

Member Data Documentation

◆ m_base

size_t PADS_IO::SDB_RECORD::m_base
private

Definition at line 333 of file pads_binary_utils.h.

Referenced by Base(), F64(), I32(), SDB_RECORD(), Str(), U16(), U32(), and U8().

◆ m_cursor

const BINARY_CURSOR& PADS_IO::SDB_RECORD::m_cursor
private

Definition at line 332 of file pads_binary_utils.h.

Referenced by F64(), I32(), SDB_RECORD(), Str(), U16(), U32(), and U8().


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