KiCad PCB EDA Suite
netlist_exporter.cpp File Reference
#include <netlist_exporter.h>
#include <confirm.h>
#include <fctsys.h>
#include <gestfich.h>
#include <pgm_base.h>
#include <refdes_utils.h>
#include <class_library.h>
#include <netlist.h>
#include <sch_reference_list.h>

Go to the source code of this file.

Functions

static bool sortPinsByNum (NETLIST_OBJECT *aPin1, NETLIST_OBJECT *aPin2)
 Comparison routine for sorting by pin numbers. More...
 

Function Documentation

◆ sortPinsByNum()

static bool sortPinsByNum ( NETLIST_OBJECT aPin1,
NETLIST_OBJECT aPin2 
)
static

Comparison routine for sorting by pin numbers.

Definition at line 151 of file netlist_exporter.cpp.

152 {
153  // return "lhs < rhs"
154  return UTIL::RefDesStringCompare( aPin1->GetPinNumText(), aPin2->GetPinNumText() ) < 0;
155 }
int RefDesStringCompare(const wxString &aFirst, const wxString &aSecond)
Acts just like the strcmp function but treats numbers within the string text correctly for sorting.
const wxString & GetPinNumText() const
Function GetPinNum returns a pin number in wxString form.

References NETLIST_OBJECT::GetPinNumText(), and UTIL::RefDesStringCompare().

Referenced by NETLIST_EXPORTER::findNextComponentAndCreatePinList().