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 756 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 1300 of file cadstar_archive_parser.cpp.

1301 {
1302  wxASSERT( aNode->GetName() == wxT( "NETCLASS" ) );
1303 
1304  ID = GetXmlAttributeIDString( aNode, 0 );
1305  Name = GetXmlAttributeIDString( aNode, 1 );
1306 
1307  XNODE* cNode = aNode->GetChildren();
1308  wxString location = wxString::Format( "NETCLASS -> %s", Name );
1309 
1310  for( ; cNode; cNode = cNode->GetNext() )
1311  {
1312  wxString cNodeName = cNode->GetName();
1313 
1314  if( cNodeName == wxT( "ATTR" ) )
1315  {
1316  ATTRIBUTE_VALUE attribute_val;
1317  attribute_val.Parse( cNode, aContext );
1318  Attributes.push_back( attribute_val );
1319  }
1320  else
1321  {
1322  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1323  }
1324  }
1325 }
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 760 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 759 of file cadstar_archive_parser.h.


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