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 901 of file eagle_parser.cpp.

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