KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DRAWING_SHEET_PARSER Class Reference

DRAWING_SHEET_PARSER holds data and functions pertinent to parsing a S-expression file for a DS_DATA_MODEL. More...

Inheritance diagram for DRAWING_SHEET_PARSER:

Public Member Functions

 DRAWING_SHEET_PARSER (const char *aLine, const wxString &aSource)
 
void Parse (DS_DATA_MODEL *aLayout)
 

Private Member Functions

void parseHeader (T aHeaderType)
 Parse the data specified at the very beginning of the file, like version and the application used to create this file.
 
int parseInt ()
 Parse an integer.
 
int parseInt (int aMin, int aMax)
 Parse an integer and constrain it between two values.
 
double parseDouble ()
 Parse a double.
 
void parseSetup (DS_DATA_MODEL *aLayout)
 
void parseGraphic (DS_DATA_ITEM *aItem)
 Parse a graphic item starting by "(line" or "(rect" and read parameters.
 
void parseText (DS_DATA_ITEM_TEXT *aItem)
 Parse a text item starting by "(tbtext" and read parameters.
 
void parsePolygon (DS_DATA_ITEM_POLYGONS *aItem)
 Parse a polygon item starting by "( polygon" and read parameters.
 
void parsePolyOutline (DS_DATA_ITEM_POLYGONS *aItem)
 Parse a list of corners starting by "( pts" and read coordinates.
 
void parseBitmap (DS_DATA_ITEM_BITMAP *aItem)
 Parse a bitmap item starting by "( bitmap" and read parameters.
 
void parseCoordinate (POINT_COORD &aCoord)
 
void readOption (DS_DATA_ITEM *aItem)
 
void readPngdata (DS_DATA_ITEM_BITMAP *aItem)
 

Private Attributes

int m_requiredVersion
 
wxString m_generatorVersion
 

Detailed Description

DRAWING_SHEET_PARSER holds data and functions pertinent to parsing a S-expression file for a DS_DATA_MODEL.

Definition at line 49 of file drawing_sheet_parser.cpp.

Constructor & Destructor Documentation

◆ DRAWING_SHEET_PARSER()

DRAWING_SHEET_PARSER::DRAWING_SHEET_PARSER ( const char *  aLine,
const wxString &  aSource 
)

Definition at line 121 of file drawing_sheet_parser.cpp.

Member Function Documentation

◆ Parse()

◆ parseBitmap()

◆ parseCoordinate()

void DRAWING_SHEET_PARSER::parseCoordinate ( POINT_COORD aCoord)
private

◆ parseDouble()

double DRAWING_SHEET_PARSER::parseDouble ( )
private

Parse a double.

Returns
double - the parsed double.

Definition at line 903 of file drawing_sheet_parser.cpp.

References DSNLEXER::parseDouble().

Referenced by parseBitmap(), parseCoordinate(), parseGraphic(), parsePolygon(), parsePolyOutline(), parseSetup(), and parseText().

◆ parseGraphic()

void DRAWING_SHEET_PARSER::parseGraphic ( DS_DATA_ITEM aItem)
private

◆ parseHeader()

void DRAWING_SHEET_PARSER::parseHeader ( aHeaderType)
private

Parse the data specified at the very beginning of the file, like version and the application used to create this file.

Definition at line 299 of file drawing_sheet_parser.cpp.

References m_requiredVersion, and parseInt().

Referenced by Parse().

◆ parseInt() [1/2]

int DRAWING_SHEET_PARSER::parseInt ( )
private

Parse an integer.

Definition at line 880 of file drawing_sheet_parser.cpp.

Referenced by parseBitmap(), parseGraphic(), parseHeader(), parseInt(), parsePolygon(), and parseText().

◆ parseInt() [2/2]

int DRAWING_SHEET_PARSER::parseInt ( int  aMin,
int  aMax 
)
private

Parse an integer and constrain it between two values.

Parameters
aMinis the smallest return value.
aMaxis the largest return value.
Returns
int - the parsed integer.

Definition at line 890 of file drawing_sheet_parser.cpp.

References parseInt().

◆ parsePolygon()

void DRAWING_SHEET_PARSER::parsePolygon ( DS_DATA_ITEM_POLYGONS aItem)
private

◆ parsePolyOutline()

void DRAWING_SHEET_PARSER::parsePolyOutline ( DS_DATA_ITEM_POLYGONS aItem)
private

Parse a list of corners starting by "( pts" and read coordinates.

Definition at line 456 of file drawing_sheet_parser.cpp.

References DS_DATA_ITEM_POLYGONS::AppendCorner(), parseDouble(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by parsePolygon().

◆ parseSetup()

◆ parseText()

◆ readOption()

void DRAWING_SHEET_PARSER::readOption ( DS_DATA_ITEM aItem)
private

◆ readPngdata()

void DRAWING_SHEET_PARSER::readPngdata ( DS_DATA_ITEM_BITMAP aItem)
private

Member Data Documentation

◆ m_generatorVersion

wxString DRAWING_SHEET_PARSER::m_generatorVersion
private

Definition at line 57 of file drawing_sheet_parser.cpp.

Referenced by Parse().

◆ m_requiredVersion

int DRAWING_SHEET_PARSER::m_requiredVersion
private

Definition at line 56 of file drawing_sheet_parser.cpp.

Referenced by Parse(), parseHeader(), and parseText().


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