KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ALLEGRO::BLOCK_PARSER Class Reference

The block parser is responsible for parsing individual blocks of data from the file stream. More...

#include <allegro_parser.h>

Public Member Functions

 BLOCK_PARSER (FILE_STREAM &aStream, FMT_VER aVer, size_t aX27End=0)
 
std::unique_ptr< BLOCK_BASEParseBlock (bool &aEndOfObjectsMarker)
 Parse one block from the stream, returning a BLOCK_BASE representing the raw data of the block.
 

Private Attributes

FILE_STREAMm_stream
 
const FMT_VER m_ver
 
const size_t m_x27_end
 To parse an 0x27 block, we need to know where the end of the block is in the stream.
 

Detailed Description

The block parser is responsible for parsing individual blocks of data from the file stream.

Most blocks don't need much context to parse in a binary sense, but most need to know the version, and one (0x27) needs to know where the end of the block is.

Definition at line 79 of file allegro_parser.h.

Constructor & Destructor Documentation

◆ BLOCK_PARSER()

ALLEGRO::BLOCK_PARSER::BLOCK_PARSER ( FILE_STREAM & aStream,
FMT_VER aVer,
size_t aX27End = 0 )
inline

Definition at line 82 of file allegro_parser.h.

References m_stream, m_ver, and m_x27_end.

Member Function Documentation

◆ ParseBlock()

std::unique_ptr< BLOCK_BASE > ALLEGRO::BLOCK_PARSER::ParseBlock ( bool & aEndOfObjectsMarker)

Parse one block from the stream, returning a BLOCK_BASE representing the raw data of the block.

Parameters
aStreamThe stream to read from, positioned at the start of the block (i.e. the next byte to read is the block type).
aEndOfObjectsMarkerThis is set to true if we encounter the end of objects marker.

Definition at line 2164 of file allegro_parser.cpp.

References m_stream, m_ver, m_x27_end, ParseBlock_0x01_ARC(), ParseBlock_0x03(), ParseBlock_0x04_NET_ASSIGNMENT(), ParseBlock_0x05_TRACK(), ParseBlock_0x06(), ParseBlock_0x07(), ParseBlock_0x08(), ParseBlock_0x09(), ParseBlock_0x0A_DRC(), ParseBlock_0x0C(), ParseBlock_0x0D_PAD(), ParseBlock_0x0E(), ParseBlock_0x0F(), ParseBlock_0x10(), ParseBlock_0x11(), ParseBlock_0x12(), ParseBlock_0x14(), ParseBlock_0x15_16_17_SEGMENT(), ParseBlock_0x1B_NET(), ParseBlock_0x1C_PADSTACK(), ParseBlock_0x1D(), ParseBlock_0x1E(), ParseBlock_0x1F(), ParseBlock_0x20(), ParseBlock_0x21(), ParseBlock_0x22(), ParseBlock_0x23_RATLINE(), ParseBlock_0x24_RECT(), ParseBlock_0x26(), ParseBlock_0x27(), ParseBlock_0x28_SHAPE(), ParseBlock_0x29_PIN(), ParseBlock_0x2A(), ParseBlock_0x2B(), ParseBlock_0x2C_TABLE(), ParseBlock_0x2D(), ParseBlock_0x2E(), ParseBlock_0x2F(), ParseBlock_0x30_STR_WRAPPER(), ParseBlock_0x31_SGRAPHIC(), ParseBlock_0x32_PLACED_PAD(), ParseBlock_0x33_VIA(), ParseBlock_0x34_KEEPOUT(), ParseBlock_0x35(), ParseBlock_0x36(), ParseBlock_0x37(), ParseBlock_0x38_FILM(), ParseBlock_0x39_FILM_LAYER_LIST(), ParseBlock_0x3A_FILM_LIST_NODE(), ParseBlock_0x3B(), ParseBlock_0x3C(), and THROW_IO_ERROR.

Referenced by ALLEGRO::PARSER::readObjects(), and ALLEGRO_BLOCK_TEST_FIXTURE::RunBlockTest().

Member Data Documentation

◆ m_stream

FILE_STREAM& ALLEGRO::BLOCK_PARSER::m_stream
private

Definition at line 99 of file allegro_parser.h.

Referenced by BLOCK_PARSER(), and ParseBlock().

◆ m_ver

const FMT_VER ALLEGRO::BLOCK_PARSER::m_ver
private

Definition at line 100 of file allegro_parser.h.

Referenced by BLOCK_PARSER(), and ParseBlock().

◆ m_x27_end

const size_t ALLEGRO::BLOCK_PARSER::m_x27_end
private

To parse an 0x27 block, we need to know where the end of the block is in the stream.

In a .brd file, this is in the header.

Definition at line 106 of file allegro_parser.h.

Referenced by BLOCK_PARSER(), and ParseBlock().


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