|
KiCad PCB EDA Suite
|
Bounds-checked little-endian read cursor over a PADS binary buffer. More...
#include <pads_binary_utils.h>
Public Member Functions | |
| BINARY_CURSOR (const std::vector< uint8_t > &aData) | |
| size_t | Size () const |
| bool | InBounds (size_t aOffset, size_t aCount) const |
| uint8_t | U8At (size_t aOffset) const |
| uint16_t | U16At (size_t aOffset) const |
| uint32_t | U32At (size_t aOffset) const |
| int32_t | I32At (size_t aOffset) const |
| double | F64At (size_t aOffset) const |
| float | F32At (size_t aOffset) const |
| std::string | StringAt (size_t aOffset, size_t aMaxLen) const |
Private Member Functions | |
| void | check (size_t aOffset, size_t aCount) const |
Private Attributes | |
| const std::vector< uint8_t > & | m_data |
Bounds-checked little-endian read cursor over a PADS binary buffer.
The *At accessors throw IO_ERROR on an out-of-range read rather than indexing past the buffer.
The cursor holds a reference to the caller's buffer, which must outlive the cursor.
Definition at line 236 of file pads_binary_utils.h.
|
inlineexplicit |
Definition at line 239 of file pads_binary_utils.h.
References m_data.
|
inlineprivate |
Definition at line 290 of file pads_binary_utils.h.
References InBounds(), m_data, and THROW_IO_ERROR.
Referenced by F32At(), F64At(), U16At(), U32At(), and U8At().
|
inline |
Definition at line 275 of file pads_binary_utils.h.
References check(), PADS_IO::getF32LE(), and m_data.
|
inline |
Definition at line 269 of file pads_binary_utils.h.
References check(), PADS_IO::getF64LE(), and m_data.
|
inline |
Definition at line 267 of file pads_binary_utils.h.
References U32At().
|
inline |
|
inline |
Definition at line 241 of file pads_binary_utils.h.
References m_data.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 284 of file pads_binary_utils.h.
References m_data, and PADS_IO::readFixedString().
|
inline |
Definition at line 255 of file pads_binary_utils.h.
References check(), PADS_IO::getU16LE(), and m_data.
|
inline |
Definition at line 261 of file pads_binary_utils.h.
References check(), PADS_IO::getU32LE(), and m_data.
Referenced by I32At().
|
inline |
Definition at line 249 of file pads_binary_utils.h.
References check(), PADS_IO::getU8(), and m_data.
Referenced by PADS_IO::viaRecordValid().
|
private |
Definition at line 299 of file pads_binary_utils.h.
Referenced by BINARY_CURSOR(), check(), F32At(), F64At(), InBounds(), Size(), StringAt(), U16At(), U32At(), and U8At().