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

Definition at line 1007 of file eagle_parser.cpp.

References getChildrenNodes(), MapChildren(), EPAD_COMMON::name, and ReplaceIllegalFileNameChars().

1008 {
1009  /*
1010  <!ELEMENT device (connects?, technologies?)>
1011  <!ATTLIST device
1012  name %String; ""
1013  package %String; #IMPLIED
1014  >
1015 */
1016  name = parseRequiredAttribute<wxString>( aDevice, "name" );
1017  opt_wxString pack = parseOptionalAttribute<wxString>( aDevice, "package" );
1018 
1019  if( pack )
1020  {
1021  std::string p( pack->c_str() );
1022  ReplaceIllegalFileNameChars( &p, '_' );
1023  package.Set( wxString::FromUTF8( p.c_str() ) );
1024  }
1025 
1026  NODE_MAP aDeviceChildren = MapChildren( aDevice );
1027  wxXmlNode* connectNode = getChildrenNodes( aDeviceChildren, "connects" );
1028 
1029  while( connectNode )
1030  {
1031  connects.push_back( ECONNECT( connectNode ) );
1032  connectNode = connectNode->GetNext();
1033  }
1034 }
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)
Function ReplaceIllegalFileNameChars checks aName for illegal file name characters.
Definition: string.cpp:650
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

Member Data Documentation

std::vector<ECONNECT> EDEVICE::connects

Definition at line 1016 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadSymbol().

wxString EDEVICE::name

Definition at line 1013 of file eagle_parser.h.

Referenced by SCH_EAGLE_PLUGIN::loadLibrary().

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: