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

Constructor & Destructor Documentation

◆ EPART()

EPART::EPART ( wxXmlNode *  aPart)

Definition at line 859 of file eagle_parser.cpp.

860 {
861  /*
862  * <!ELEMENT part (attribute*, variant*)>
863  * <!ATTLIST part
864  * name %String; #REQUIRED
865  * library %String; #REQUIRED
866  * deviceset %String; #REQUIRED
867  * device %String; #REQUIRED
868  * technology %String; ""
869  * value %String; #IMPLIED
870  * >
871  */
872  // #REQUIRED
873  name = parseRequiredAttribute<wxString>( aPart, "name" );
874  library = parseRequiredAttribute<wxString>( aPart, "library" );
875  deviceset = parseRequiredAttribute<wxString>( aPart, "deviceset" );
876  device = parseRequiredAttribute<wxString>( aPart, "device" );
877  technology = parseOptionalAttribute<wxString>( aPart, "technology" );
878  value = parseOptionalAttribute<wxString>( aPart, "value" );
879 
880  for( auto child = aPart->GetChildren(); child; child = child->GetNext() )
881  {
882 
883  if( child->GetName() == "attribute" )
884  {
885  std::string aname, avalue;
886  for( auto x = child->GetAttributes(); x; x = x->GetNext() )
887  {
888 
889  if( x->GetName() == "name" )
890  aname = x->GetValue();
891  else if( x->GetName() == "value" )
892  avalue = x->GetValue();
893  }
894 
895  if( aname.size() && avalue.size() )
896  attribute[aname] = avalue;
897  }
898  else if( child->GetName() == "variant" )
899  {
900  std::string aname, avalue;
901  for( auto x = child->GetAttributes(); x; x = x->GetNext() )
902  {
903 
904  if( x->GetName() == "name" )
905  aname = x->GetValue();
906  else if( x->GetName() == "value" )
907  avalue = x->GetValue();
908  }
909 
910  if( aname.size() && avalue.size() )
911  variant[aname] = avalue;
912  }
913  }
914 }
wxString deviceset
Definition: eagle_parser.h:912
wxString name
Definition: eagle_parser.h:910
opt_wxString technology
Definition: eagle_parser.h:914
wxString library
Definition: eagle_parser.h:911
std::map< std::string, std::string > variant
Definition: eagle_parser.h:917
opt_wxString value
Definition: eagle_parser.h:915
std::map< std::string, std::string > attribute
Definition: eagle_parser.h:916
wxString device
Definition: eagle_parser.h:913

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

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ device

wxString EPART::device

Definition at line 913 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ deviceset

wxString EPART::deviceset

Definition at line 912 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ library

wxString EPART::library

Definition at line 911 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ name

wxString EPART::name

Definition at line 910 of file eagle_parser.h.

◆ technology

opt_wxString EPART::technology

Definition at line 914 of file eagle_parser.h.

◆ value

opt_wxString EPART::value

Definition at line 915 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

◆ variant

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

Definition at line 917 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().


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