KiCad PCB EDA Suite
CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE Struct Reference

#include <cadstar_sch_archive_parser.h>

Inheritance diagram for CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

TERMINALCODE_ID ID
 
wxString Name
 
TERMINAL_SHAPE Shape
 
bool Filled = false
 

Detailed Description

Definition at line 99 of file cadstar_sch_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 254 of file cadstar_sch_archive_parser.cpp.

255{
256 wxCHECK( aNode->GetName() == wxT( "TERMINALCODE" ), );
257
258 ID = GetXmlAttributeIDString( aNode, 0 );
259 Name = GetXmlAttributeIDString( aNode, 1 );
260
261 XNODE* cNode = aNode->GetChildren();
262 wxString location = wxString::Format( "TERMINALCODE -> %s", Name );
263
264 for( ; cNode; cNode = cNode->GetNext() )
265 {
266 wxString cNodeName = cNode->GetName();
267
268 if( TERMINAL_SHAPE::IsTermShape( cNode ) )
269 Shape.Parse( cNode, aContext );
270 else if( cNodeName == wxT( "FILLED" ) )
271 Filled = true;
272 else
273 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
274 }
275}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override

References Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::IsTermShape(), and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::CODEDEFS_SCM::Parse().

Member Data Documentation

◆ Filled

bool CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Filled = false

Definition at line 104 of file cadstar_sch_archive_parser.h.

◆ ID

TERMINALCODE_ID CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::ID

◆ Name

wxString CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Name

Definition at line 102 of file cadstar_sch_archive_parser.h.

◆ Shape

TERMINAL_SHAPE CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Shape

Definition at line 103 of file cadstar_sch_archive_parser.h.


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