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 ( wxXmlNode *  aPart)

Definition at line 869 of file eagle_parser.cpp.

References EPAD_COMMON::name, and EPAD_COMMON::x.

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

Member Data Documentation

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

Definition at line 916 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

wxString EPART::device

Definition at line 913 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

wxString EPART::deviceset

Definition at line 912 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

wxString EPART::library

Definition at line 911 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

wxString EPART::name

Definition at line 910 of file eagle_parser.h.

opt_wxString EPART::technology

Definition at line 914 of file eagle_parser.h.

opt_wxString EPART::value

Definition at line 915 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadInstance().

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: