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 897 of file eagle_parser.h.

Constructor & Destructor Documentation

◆ EPART()

EPART::EPART ( wxXmlNode *  aPart)

Definition at line 876 of file eagle_parser.cpp.

877 {
878  /*
879  * <!ELEMENT part (attribute*, variant*)>
880  * <!ATTLIST part
881  * name %String; #REQUIRED
882  * library %String; #REQUIRED
883  * deviceset %String; #REQUIRED
884  * device %String; #REQUIRED
885  * technology %String; ""
886  * value %String; #IMPLIED
887  * >
888  */
889  // #REQUIRED
890  name = parseRequiredAttribute<wxString>( aPart, "name" );
891  library = parseRequiredAttribute<wxString>( aPart, "library" );
892  deviceset = parseRequiredAttribute<wxString>( aPart, "deviceset" );
893  device = parseRequiredAttribute<wxString>( aPart, "device" );
894  technology = parseOptionalAttribute<wxString>( aPart, "technology" );
895  value = parseOptionalAttribute<wxString>( aPart, "value" );
896 
897  for( auto child = aPart->GetChildren(); child; child = child->GetNext() )
898  {
899 
900  if( child->GetName() == "attribute" )
901  {
902  std::string aname, avalue;
903  for( auto x = child->GetAttributes(); x; x = x->GetNext() )
904  {
905 
906  if( x->GetName() == "name" )
907  aname = x->GetValue();
908  else if( x->GetName() == "value" )
909  avalue = x->GetValue();
910  }
911 
912  if( aname.size() && avalue.size() )
913  attribute[aname] = avalue;
914  }
915  else if( child->GetName() == "variant" )
916  {
917  std::string aname, avalue;
918  for( auto x = child->GetAttributes(); x; x = x->GetNext() )
919  {
920 
921  if( x->GetName() == "name" )
922  aname = x->GetValue();
923  else if( x->GetName() == "value" )
924  avalue = x->GetValue();
925  }
926 
927  if( aname.size() && avalue.size() )
928  variant[aname] = avalue;
929  }
930  }
931 }
wxString deviceset
Definition: eagle_parser.h:913
wxString name
Definition: eagle_parser.h:911
opt_wxString technology
Definition: eagle_parser.h:915
wxString library
Definition: eagle_parser.h:912
std::map< std::string, std::string > variant
Definition: eagle_parser.h:918
opt_wxString value
Definition: eagle_parser.h:916
std::map< std::string, std::string > attribute
Definition: eagle_parser.h:917
wxString device
Definition: eagle_parser.h:914

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 917 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ device

wxString EPART::device

Definition at line 914 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ deviceset

wxString EPART::deviceset

Definition at line 913 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ library

wxString EPART::library

Definition at line 912 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ name

wxString EPART::name

Definition at line 911 of file eagle_parser.h.

◆ technology

opt_wxString EPART::technology

Definition at line 915 of file eagle_parser.h.

◆ value

opt_wxString EPART::value

Definition at line 916 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ variant

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

Definition at line 918 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().


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