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

Constructor & Destructor Documentation

◆ EDEVICE()

EDEVICE::EDEVICE ( wxXmlNode *  aDevice)

Definition at line 997 of file eagle_parser.cpp.

998 {
999  /*
1000  <!ELEMENT device (connects?, technologies?)>
1001  <!ATTLIST device
1002  name %String; ""
1003  package %String; #IMPLIED
1004  >
1005 */
1006  name = parseRequiredAttribute<wxString>( aDevice, "name" );
1007  opt_wxString pack = parseOptionalAttribute<wxString>( aDevice, "package" );
1008 
1009  if( pack )
1010  {
1011  std::string p( pack->c_str() );
1012  ReplaceIllegalFileNameChars( &p, '_' );
1013  package.Set( wxString::FromUTF8( p.c_str() ) );
1014  }
1015 
1016  NODE_MAP aDeviceChildren = MapChildren( aDevice );
1017  wxXmlNode* connectNode = getChildrenNodes( aDeviceChildren, "connects" );
1018 
1019  while( connectNode )
1020  {
1021  connects.emplace_back( connectNode );
1022  connectNode = connectNode->GetNext();
1023  }
1024 }
void Set(const wxString &aString)
Function Set tries to convert a string to the base type.
Definition: eagle_parser.h:289
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar)
Checks aName for illegal file name characters.
Definition: string.cpp:708
NODE_MAP MapChildren(wxXmlNode *aCurrentNode)
Function MapChildren provides 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:48
static wxXmlNode * getChildrenNodes(NODE_MAP &aMap, const wxString &aName)
Definition: eagle_parser.h:58

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

Member Data Documentation

◆ connects

std::vector<ECONNECT> EDEVICE::connects

Definition at line 1016 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadSymbol().

◆ name

wxString EDEVICE::name

Definition at line 1013 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadLibrary().

◆ package

opt_wxString EDEVICE::package

Definition at line 1014 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadLibrary().


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