KiCad PCB EDA Suite
pcb_netlist.cpp File Reference
#include <refdes_utils.h>
#include "pcb_netlist.h"
#include <class_module.h>

Go to the source code of this file.

Functions

static bool ByFPID (const COMPONENT &ref, const COMPONENT &cmp)
 Function ByFPID is a helper function used to sort the component list used by loadNewModules. More...
 
bool operator< (const COMPONENT &item1, const COMPONENT &item2)
 Operator < compares two COMPONENT objects by reference designator. More...
 

Function Documentation

◆ ByFPID()

static bool ByFPID ( const COMPONENT ref,
const COMPONENT cmp 
)
static

Function ByFPID is a helper function used to sort the component list used by loadNewModules.

Definition at line 177 of file pcb_netlist.cpp.

178 {
179  return ref.GetFPID() > cmp.GetFPID();
180 }
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:157

References COMPONENT::GetFPID().

Referenced by NETLIST::SortByFPID().

◆ operator<()

bool operator< ( const COMPONENT item1,
const COMPONENT item2 
)

Operator < compares two COMPONENT objects by reference designator.

Definition at line 193 of file pcb_netlist.cpp.

194 {
195  return UTIL::RefDesStringCompare( item1.GetReference(), item2.GetReference() ) < 0;
196 }
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 & GetReference() const
Definition: pcb_netlist.h:147

References COMPONENT::GetReference(), and UTIL::RefDesStringCompare().