KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::HATCHCODE Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::HATCHCODE:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

HATCHCODE_ID ID
 
wxString Name
 
std::vector< HATCHHatches
 

Detailed Description

Definition at line 311 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 244 of file cadstar_archive_parser.cpp.

245 {
246  wxASSERT( aNode->GetName() == wxT( "HATCHCODE" ) );
247 
248  ID = GetXmlAttributeIDString( aNode, 0 );
249  Name = GetXmlAttributeIDString( aNode, 1 );
250 
251  XNODE* cNode = aNode->GetChildren();
252  wxString location = wxString::Format( "HATCHCODE -> %s", Name );
253 
254  for( ; cNode; cNode = cNode->GetNext() )
255  {
256  if( cNode->GetName() != wxT( "HATCH" ) )
257  THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), location );
258 
259  HATCH hatch;
260  hatch.Parse( cNode, aContext );
261  Hatches.push_back( hatch );
262  }
263 }
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::HATCH::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.

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

Member Data Documentation

◆ Hatches

◆ ID

HATCHCODE_ID CADSTAR_ARCHIVE_PARSER::HATCHCODE::ID

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::HATCHCODE::Name

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