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.


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,

Comparison routine for sorting by pin numbers.

Definition at line 143 of file netlist_exporter.cpp.

144 {
145  // return "lhs < rhs"
146  return UTIL::RefDesStringCompare( aPin1->GetPinNumText(), aPin2->GetPinNumText() ) < 0;
147 }
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
returns a pin number in wxString form.

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

Referenced by NETLIST_EXPORTER::CreatePinList().