KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::HEADER Struct Reference

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::HEADER:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

FORMAT Format
 
wxString JobFile
 
wxString JobTitle
 
wxString Generator
 
RESOLUTION Resolution
 
TIMESTAMP Timestamp
 

Detailed Description

Definition at line 252 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

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

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 85 of file cadstar_archive_parser.cpp.

86{
87 wxASSERT( aNode->GetName() == wxT( "HEADER" ) );
88
89 XNODE* cNode = aNode->GetChildren();
90
91 for( ; cNode; cNode = cNode->GetNext() )
92 {
93 wxString nodeName = cNode->GetName();
94
95 if( nodeName == wxT( "FORMAT" ) )
96 {
97 Format.Parse( cNode, aContext );
98 }
99 else if( nodeName == wxT( "JOBFILE" ) )
100 {
101 JobFile = GetXmlAttributeIDString( cNode, 0 );
102 }
103 else if( nodeName == wxT( "JOBTITLE" ) )
104 {
105 JobTitle = GetXmlAttributeIDString( cNode, 0 );
106 }
107 else if( nodeName == wxT( "GENERATOR" ) )
108 {
110 }
111 else if( nodeName == wxT( "RESOLUTION" ) )
112 {
113 XNODE* subNode = cNode->GetChildren();
114
115 if( ( subNode->GetName() == wxT( "METRIC" ) )
116 && ( GetXmlAttributeIDString( subNode, 0 ) == wxT( "HUNDREDTH" ) )
117 && ( GetXmlAttributeIDString( subNode, 1 ) == wxT( "MICRON" ) ) )
118 {
120 }
121 else
122 {
123 // TODO Need to find out if there are other possible resolutions. Logically
124 // there must be other base units that could be used, such as "IMPERIAL INCH"
125 // or "METRIC MM" but so far none of settings in CADSTAR generated a different
126 // output resolution to "HUNDREDTH MICRON"
127 THROW_UNKNOWN_NODE_IO_ERROR( subNode->GetName(), wxT( "HEADER->RESOLUTION" ) );
128 }
129 }
130 else if( nodeName == wxT( "TIMESTAMP" ) )
131 {
132 Timestamp.Parse( cNode, aContext );
133 }
134 else
135 {
136 THROW_UNKNOWN_NODE_IO_ERROR( cNode->GetName(), wxT( "HEADER" ) );
137 }
138 }
139}
#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 Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override

References Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::HUNDREDTH_MICRON, and THROW_UNKNOWN_NODE_IO_ERROR.

Referenced by CADSTAR_SCH_ARCHIVE_PARSER::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::Parse().

Member Data Documentation

◆ Format

◆ Generator

wxString CADSTAR_ARCHIVE_PARSER::HEADER::Generator

Definition at line 257 of file cadstar_archive_parser.h.

◆ JobFile

wxString CADSTAR_ARCHIVE_PARSER::HEADER::JobFile

Definition at line 255 of file cadstar_archive_parser.h.

◆ JobTitle

wxString CADSTAR_ARCHIVE_PARSER::HEADER::JobTitle

◆ Resolution

RESOLUTION CADSTAR_ARCHIVE_PARSER::HEADER::Resolution

◆ Timestamp

TIMESTAMP CADSTAR_ARCHIVE_PARSER::HEADER::Timestamp

Definition at line 259 of file cadstar_archive_parser.h.


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