KiCad PCB EDA Suite
ACLASS6 Struct Reference

#include <altium_parser_pcb.h>

Public Member Functions

 ACLASS6 (ALTIUM_PARSER &aReader)
 

Public Attributes

wxString name
 
wxString uniqueid
 
ALTIUM_CLASS_KIND kind
 
std::vector< wxString > names
 

Detailed Description

Definition at line 359 of file altium_parser_pcb.h.

Constructor & Destructor Documentation

◆ ACLASS6()

ACLASS6::ACLASS6 ( ALTIUM_PARSER aReader)
explicit

Definition at line 213 of file altium_parser_pcb.cpp.

214 {
215  std::map<wxString, wxString> properties = aReader.ReadProperties();
216 
217  if( properties.empty() )
218  THROW_IO_ERROR( "Classes6 stream has no properties!" );
219 
220  name = ALTIUM_PARSER::ReadString( properties, "NAME", "" );
221  uniqueid = ALTIUM_PARSER::ReadString( properties, "UNIQUEID", "" );
222  kind = static_cast<ALTIUM_CLASS_KIND>( ALTIUM_PARSER::ReadInt( properties, "KIND", -1 ) );
223 
224  for( size_t i = 0; i < std::numeric_limits<size_t>::max(); i++ )
225  {
226  auto mit = properties.find( "M" + std::to_string( i ) );
227 
228  if( mit == properties.end() )
229  break; // it doesn't seem like we know beforehand how many components are in the netclass
230 
231  names.push_back( mit->second );
232  }
233 
234  if( aReader.HasParsingError() )
235  THROW_IO_ERROR( "Classes6 stream was not parsed correctly" );
236 }
std::vector< wxString > names
static int ReadInt(const std::map< wxString, wxString > &aProps, const wxString &aKey, int aDefault)
std::map< wxString, wxString > ReadProperties()
ALTIUM_CLASS_KIND kind
wxString name
wxString uniqueid
static wxString ReadString(const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
bool HasParsingError()

References ALTIUM_PARSER::HasParsingError(), kind, name, names, ALTIUM_PARSER::ReadInt(), ALTIUM_PARSER::ReadProperties(), ALTIUM_PARSER::ReadString(), THROW_IO_ERROR, and uniqueid.

Member Data Documentation

◆ kind

ALTIUM_CLASS_KIND ACLASS6::kind

Definition at line 364 of file altium_parser_pcb.h.

Referenced by ACLASS6(), and ALTIUM_PCB::ParseClasses6Data().

◆ name

wxString ACLASS6::name

Definition at line 361 of file altium_parser_pcb.h.

Referenced by ACLASS6(), and ALTIUM_PCB::ParseClasses6Data().

◆ names

std::vector<wxString> ACLASS6::names

Definition at line 366 of file altium_parser_pcb.h.

Referenced by ACLASS6(), and ALTIUM_PCB::ParseClasses6Data().

◆ uniqueid

wxString ACLASS6::uniqueid

Definition at line 362 of file altium_parser_pcb.h.

Referenced by ACLASS6().


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