KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KICAD_DIFF::SYM_LIB_DIFFER Class Reference

Diff two .kicad_sym symbol libraries. More...

#include <sym_lib_differ.h>

Inheritance diagram for KICAD_DIFF::SYM_LIB_DIFFER:
KICAD_DIFF::KICAD_DIFFER

Public Types

using SYMBOL_MAP = std::map<wxString, const LIB_SYMBOL*>
 Library content is a map of (canonical_name -> LIB_SYMBOL*).
 

Public Member Functions

 SYM_LIB_DIFFER (const SYMBOL_MAP &aBefore, const SYMBOL_MAP &aAfter, const wxString &aPath=wxEmptyString)
 
 ~SYM_LIB_DIFFER () override
 
DOCUMENT_DIFF Diff () override
 Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
 
void SetOptions (const OPTIONS &aOptions)
 
const OPTIONSGetOptions () const
 

Static Public Member Functions

static std::pair< std::vector< std::unique_ptr< LIB_SYMBOL > >, SYMBOL_MAPLoadLibrary (const wxString &aPath)
 Convenience: load a .kicad_sym path into a SYMBOL_MAP using SCH_IO_KICAD_SEXPR::EnumerateSymbolLib.
 

Protected Attributes

OPTIONS m_options
 

Private Attributes

const SYMBOL_MAPm_before
 
const SYMBOL_MAPm_after
 
wxString m_path
 

Detailed Description

Diff two .kicad_sym symbol libraries.

Identity is symbol name (LIB_ID::GetLibItemName()) — library files are not UUID-keyed; the name is the contract. Renamed symbols look like (REMOVED old, ADDED new) which is correct for libraries: the names are user-facing API for downstream schematics.

Per-symbol delta uses LIB_SYMBOL::Compare(), which returns an int describing the first non-equal field (signed comparison). The differ emits a coarse MODIFIED record per changed symbol; per-pin / per-graphic detail can be surfaced by the single-symbol differ (sym_item_differ) which the UI invokes on click-through.

Definition at line 54 of file sym_lib_differ.h.

Member Typedef Documentation

◆ SYMBOL_MAP

using KICAD_DIFF::SYM_LIB_DIFFER::SYMBOL_MAP = std::map<wxString, const LIB_SYMBOL*>

Library content is a map of (canonical_name -> LIB_SYMBOL*).

The caller retains ownership of the symbols.

Definition at line 59 of file sym_lib_differ.h.

Constructor & Destructor Documentation

◆ SYM_LIB_DIFFER()

KICAD_DIFF::SYM_LIB_DIFFER::SYM_LIB_DIFFER ( const SYMBOL_MAP & aBefore,
const SYMBOL_MAP & aAfter,
const wxString & aPath = wxEmptyString )

Definition at line 38 of file sym_lib_differ.cpp.

References m_after, m_before, and m_path.

◆ ~SYM_LIB_DIFFER()

KICAD_DIFF::SYM_LIB_DIFFER::~SYM_LIB_DIFFER ( )
overridedefault

Member Function Documentation

◆ Diff()

◆ GetOptions()

const OPTIONS & KICAD_DIFF::KICAD_DIFFER::GetOptions ( ) const
inlineinherited

Definition at line 67 of file kicad_differ.h.

References m_options.

◆ LoadLibrary()

std::pair< std::vector< std::unique_ptr< LIB_SYMBOL > >, SYM_LIB_DIFFER::SYMBOL_MAP > KICAD_DIFF::SYM_LIB_DIFFER::LoadLibrary ( const wxString & aPath)
static

◆ SetOptions()

void KICAD_DIFF::KICAD_DIFFER::SetOptions ( const OPTIONS & aOptions)
inlineinherited

Definition at line 66 of file kicad_differ.h.

References m_options.

Member Data Documentation

◆ m_after

const SYMBOL_MAP& KICAD_DIFF::SYM_LIB_DIFFER::m_after
private

Definition at line 75 of file sym_lib_differ.h.

Referenced by Diff(), and SYM_LIB_DIFFER().

◆ m_before

const SYMBOL_MAP& KICAD_DIFF::SYM_LIB_DIFFER::m_before
private

Definition at line 74 of file sym_lib_differ.h.

Referenced by Diff(), and SYM_LIB_DIFFER().

◆ m_options

◆ m_path

wxString KICAD_DIFF::SYM_LIB_DIFFER::m_path
private

Definition at line 76 of file sym_lib_differ.h.

Referenced by Diff(), and SYM_LIB_DIFFER().


The documentation for this class was generated from the following files: