KiCad PCB EDA Suite
EDEVICE Struct Reference

#include <eagle_parser.h>

Public Member Functions

 EDEVICE (wxXmlNode *aDevice)
 

Public Attributes

wxString name
 
opt_wxString package
 
std::vector< ECONNECTconnects
 

Detailed Description

Definition at line 1017 of file eagle_parser.h.

Constructor & Destructor Documentation

◆ EDEVICE()

EDEVICE::EDEVICE ( wxXmlNode *  aDevice)

Definition at line 1039 of file eagle_parser.cpp.

1040 {
1041  /*
1042  <!ELEMENT device (connects?, technologies?)>
1043  <!ATTLIST device
1044  name %String; ""
1045  package %String; #IMPLIED
1046  >
1047  */
1048  name = parseRequiredAttribute<wxString>( aDevice, "name" );
1049  opt_wxString pack = parseOptionalAttribute<wxString>( aDevice, "package" );
1050 
1051  if( pack )
1052  {
1053  std::string p( pack->c_str() );
1054  ReplaceIllegalFileNameChars( &p, '_' );
1055  package.Set( wxString::FromUTF8( p.c_str() ) );
1056  }
1057 
1058  NODE_MAP aDeviceChildren = MapChildren( aDevice );
1059  wxXmlNode* connectNode = getChildrenNodes( aDeviceChildren, "connects" );
1060 
1061  while( connectNode )
1062  {
1063  connects.emplace_back( connectNode );
1064  connectNode = connectNode->GetNext();
1065  }
1066 }
void Set(const wxString &aString)
Attempt to convert a string to the base type.
Definition: eagle_parser.h:281
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar)
Checks aName for illegal file name characters.
Definition: string.cpp:766
NODE_MAP MapChildren(wxXmlNode *aCurrentNode)
Provide an easy access to the children of an XML node via their names.
wxString name
std::vector< ECONNECT > connects
opt_wxString package
std::unordered_map< wxString, wxXmlNode * > NODE_MAP
Definition: eagle_parser.h:47
static wxXmlNode * getChildrenNodes(NODE_MAP &aMap, const wxString &aName)
Definition: eagle_parser.h:57

References getChildrenNodes(), MapChildren(), EELEMENT::name, EELEMENT::package, and ReplaceIllegalFileNameChars().

Member Data Documentation

◆ connects

std::vector<ECONNECT> EDEVICE::connects

Definition at line 1029 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadSymbol().

◆ name

wxString EDEVICE::name

Definition at line 1026 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadLibrary().

◆ package

opt_wxString EDEVICE::package

Definition at line 1027 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadLibrary().


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