KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

NETCLASS_ID ID
 
wxString Name
 
std::vector< ATTRIBUTE_VALUEAttributes
 

Detailed Description

Definition at line 800 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1413 of file cadstar_archive_parser.cpp.

1414{
1415 wxASSERT( aNode->GetName() == wxT( "NETCLASS" ) );
1416
1417 ID = GetXmlAttributeIDString( aNode, 0 );
1418 Name = GetXmlAttributeIDString( aNode, 1 );
1419
1420 XNODE* cNode = aNode->GetChildren();
1421 wxString location = wxString::Format( "NETCLASS -> %s", Name );
1422
1423 for( ; cNode; cNode = cNode->GetNext() )
1424 {
1425 wxString cNodeName = cNode->GetName();
1426
1427 if( cNodeName == wxT( "ATTR" ) )
1428 {
1429 ATTRIBUTE_VALUE attribute_val;
1430 attribute_val.Parse( cNode, aContext );
1431 Attributes.push_back( attribute_val );
1432 }
1433 else
1434 {
1435 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1436 }
1437 }
1438}
#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

References Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_ARCHIVE_PARSER::CODEDEFS::ParseSubNode().

Member Data Documentation

◆ Attributes

std::vector<ATTRIBUTE_VALUE> CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::Attributes

Definition at line 804 of file cadstar_archive_parser.h.

◆ ID

NETCLASS_ID CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::ID

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::Name

Definition at line 803 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().


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