KiCad PCB EDA Suite
EPART Struct Reference

#include <eagle_parser.h>

Public Member Functions

 EPART (wxXmlNode *aPart)
 

Public Attributes

wxString name
 
wxString library
 
wxString deviceset
 
wxString device
 
opt_wxString technology
 
opt_wxString value
 
std::map< std::string, std::string > attribute
 
std::map< std::string, std::string > variant
 

Detailed Description

Definition at line 909 of file eagle_parser.h.

Constructor & Destructor Documentation

◆ EPART()

EPART::EPART ( wxXmlNode *  aPart)

Definition at line 904 of file eagle_parser.cpp.

905 {
906  /*
907  * <!ELEMENT part (attribute*, variant*)>
908  * <!ATTLIST part
909  * name %String; #REQUIRED
910  * library %String; #REQUIRED
911  * deviceset %String; #REQUIRED
912  * device %String; #REQUIRED
913  * technology %String; ""
914  * value %String; #IMPLIED
915  * >
916  */
917  // #REQUIRED
918  name = parseRequiredAttribute<wxString>( aPart, wxT( "name" ) );
919  library = parseRequiredAttribute<wxString>( aPart, wxT( "library" ) );
920  deviceset = parseRequiredAttribute<wxString>( aPart, wxT( "deviceset" ) );
921  device = parseRequiredAttribute<wxString>( aPart, wxT( "device" ) );
922  technology = parseOptionalAttribute<wxString>( aPart, wxT( "technology" ) );
923  value = parseOptionalAttribute<wxString>( aPart, wxT( "value" ) );
924 
925  for( wxXmlNode* child = aPart->GetChildren(); child; child = child->GetNext() )
926  {
927  if( child->GetName() == wxT( "attribute" ) )
928  {
929  std::string aname, avalue;
930 
931  for( wxXmlAttribute* x = child->GetAttributes(); x; x = x->GetNext() )
932  {
933  if( x->GetName() == wxT( "name" ) )
934  aname = x->GetValue();
935  else if( x->GetName() == wxT( "value" ) )
936  avalue = x->GetValue();
937  }
938 
939  if( aname.size() && avalue.size() )
940  attribute[aname] = avalue;
941  }
942  else if( child->GetName() == wxT( "variant" ) )
943  {
944  std::string aname, avalue;
945 
946  for( wxXmlAttribute* x = child->GetAttributes(); x; x = x->GetNext() )
947  {
948  if( x->GetName() == wxT( "name" ) )
949  aname = x->GetValue();
950  else if( x->GetName() == wxT( "value" ) )
951  avalue = x->GetValue();
952  }
953 
954  if( aname.size() && avalue.size() )
955  variant[aname] = avalue;
956  }
957  }
958 }
wxString deviceset
Definition: eagle_parser.h:925
wxString name
Definition: eagle_parser.h:923
opt_wxString technology
Definition: eagle_parser.h:927
wxString library
Definition: eagle_parser.h:924
std::map< std::string, std::string > variant
Definition: eagle_parser.h:930
opt_wxString value
Definition: eagle_parser.h:928
std::map< std::string, std::string > attribute
Definition: eagle_parser.h:929
wxString device
Definition: eagle_parser.h:926

References EELEMENT::library, EELEMENT::name, EELEMENT::value, and EELEMENT::x.

Member Data Documentation

◆ attribute

std::map<std::string,std::string> EPART::attribute

Definition at line 929 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ device

wxString EPART::device

Definition at line 926 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ deviceset

wxString EPART::deviceset

Definition at line 925 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ library

wxString EPART::library

Definition at line 924 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ name

wxString EPART::name

Definition at line 923 of file eagle_parser.h.

◆ technology

opt_wxString EPART::technology

Definition at line 927 of file eagle_parser.h.

◆ value

opt_wxString EPART::value

Definition at line 928 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ variant

std::map<std::string,std::string> EPART::variant

Definition at line 930 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().


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