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 318 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 245 of file cadstar_archive_parser.cpp.

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