KiCad PCB EDA Suite
pcb_netlist.cpp File Reference
#include <macros.h>
#include <kicad_string.h>
#include <reporter.h>
#include <pcb_netlist.h>
#include <class_module.h>
#include <eda_pattern_match.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

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 182 of file pcb_netlist.cpp.

References COMPONENT::GetFPID().

Referenced by NETLIST::SortByFPID().

183 {
184  return ref.GetFPID() > cmp.GetFPID();
185 }
const LIB_ID & GetFPID() const
Definition: pcb_netlist.h:164
bool operator< ( const COMPONENT item1,
const COMPONENT item2 
)

Operator < compares two COMPONENT objects by reference designator.

Definition at line 198 of file pcb_netlist.cpp.

References COMPONENT::GetReference(), and StrNumCmp().

199 {
200  return StrNumCmp( item1.GetReference(), item2.GetReference(), INT_MAX, true ) < 0;
201 }
const wxString & GetReference() const
Definition: pcb_netlist.h:149
int StrNumCmp(const wxString &aString1, const wxString &aString2, int aLength, bool aIgnoreCase)
Function StrLenNumCmp is a routine compatible with qsort() to sort by alphabetical order...
Definition: string.cpp:238