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 299 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 238 of file cadstar_archive_parser.cpp.

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