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 768 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 1308 of file cadstar_archive_parser.cpp.

1309 {
1310  wxASSERT( aNode->GetName() == wxT( "NETCLASS" ) );
1311 
1312  ID = GetXmlAttributeIDString( aNode, 0 );
1313  Name = GetXmlAttributeIDString( aNode, 1 );
1314 
1315  XNODE* cNode = aNode->GetChildren();
1316  wxString location = wxString::Format( "NETCLASS -> %s", Name );
1317 
1318  for( ; cNode; cNode = cNode->GetNext() )
1319  {
1320  wxString cNodeName = cNode->GetName();
1321 
1322  if( cNodeName == wxT( "ATTR" ) )
1323  {
1324  ATTRIBUTE_VALUE attribute_val;
1325  attribute_val.Parse( cNode, aContext );
1326  Attributes.push_back( attribute_val );
1327  }
1328  else
1329  {
1330  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1331  }
1332  }
1333 }
XNODE * GetChildren() const
Definition: xnode.h:62
Hold an XML or S-expression element.
Definition: xnode.h:43
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
XNODE * GetNext() const
Definition: xnode.h:67
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)

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 772 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 771 of file cadstar_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet().


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