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

Parses a .brd header, taking care of any version-specific differences. More...

#include <allegro_parser.h>

Public Member Functions

 HEADER_PARSER (FILE_STREAM &aStream)
 
std::unique_ptr< FILE_HEADERParseHeader ()
 
FMT_VER GetFormatVersion () const
 Get the parsed format version.
 

Static Public Member Functions

static FMT_VER FormatFromMagic (uint32_t aMagic)
 Determine the format version from the magic number.
 

Private Attributes

FILE_STREAMm_stream
 
FMT_VER m_fmtVer
 

Detailed Description

Parses a .brd header, taking care of any version-specific differences.

Encapsulates any state and context needed to parse the header.

Definition at line 44 of file allegro_parser.h.

Constructor & Destructor Documentation

◆ HEADER_PARSER()

ALLEGRO::HEADER_PARSER::HEADER_PARSER ( FILE_STREAM & aStream)
inline

Definition at line 47 of file allegro_parser.h.

References m_fmtVer, m_stream, and ALLEGRO::V_UNKNOWN.

Member Function Documentation

◆ FormatFromMagic()

FMT_VER HEADER_PARSER::FormatFromMagic ( uint32_t aMagic)
static

Determine the format version from the magic number.

Definition at line 153 of file allegro_parser.cpp.

References THROW_IO_ERROR, ALLEGRO::V_160, ALLEGRO::V_162, ALLEGRO::V_164, ALLEGRO::V_165, ALLEGRO::V_166, ALLEGRO::V_172, ALLEGRO::V_174, ALLEGRO::V_175, ALLEGRO::V_180, and ALLEGRO::V_PRE_V16.

Referenced by ParseHeader().

◆ GetFormatVersion()

FMT_VER ALLEGRO::HEADER_PARSER::GetFormatVersion ( ) const
inline

Get the parsed format version.

This is only valid after ParseHeader() has been called successfully.

Definition at line 60 of file allegro_parser.h.

References m_fmtVer.

Referenced by ALLEGRO::PARSER::Parse(), and ALLEGRO_BLOCK_TEST_FIXTURE::RunHeaderTest().

◆ ParseHeader()

Member Data Documentation

◆ m_fmtVer

FMT_VER ALLEGRO::HEADER_PARSER::m_fmtVer
private

Definition at line 69 of file allegro_parser.h.

Referenced by GetFormatVersion(), HEADER_PARSER(), and ParseHeader().

◆ m_stream

FILE_STREAM& ALLEGRO::HEADER_PARSER::m_stream
private

Definition at line 68 of file allegro_parser.h.

Referenced by HEADER_PARSER(), and ParseHeader().


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