|
KiCad PCB EDA Suite
|
Diff two .kicad_sym symbol libraries. More...
#include <sym_lib_differ.h>
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 OPTIONS & | GetOptions () const |
Static Public Member Functions | |
| static std::pair< std::vector< std::unique_ptr< LIB_SYMBOL > >, SYMBOL_MAP > | LoadLibrary (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_MAP & | m_before |
| const SYMBOL_MAP & | m_after |
| wxString | m_path |
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.
| 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.
| 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.
|
overridedefault |
|
overridevirtual |
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
Must be deterministic for fixed inputs. Concrete differs sort their output by KIID_PATH so the JSON serialization is bit-stable across runs.
Implements KICAD_DIFF::KICAD_DIFFER.
Definition at line 119 of file sym_lib_differ.cpp.
References KICAD_DIFF::ITEM_CHANGE::children, KICAD_DIFF::DiffItemProperties(), KICAD_DIFF::DiffLibraryByName(), KICAD_DIFF::DiffSymbolElements(), LIB_SYMBOL::GetUnitBoundingBox(), KICAD_DIFF::ITEM_CHANGE::kind, m_after, m_before, KICAD_DIFF::KICAD_DIFFER::m_options, m_path, KICAD_DIFF::MODIFIED, KICAD_DIFF::ITEM_CHANGE::properties, KICAD_DIFF::ITEM_CHANGE::refdes, result, and KICAD_DIFF::ITEM_CHANGE::typeName.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SYMBOL_EDITOR_CONTROL::CompareLibraryWithFile(), EESCHEMA_JOBS_HANDLER::JobSymDiff(), EESCHEMA_JOBS_HANDLER::OpenDiffDialog(), and EESCHEMA_JOBS_HANDLER::runSymLibMerge().
|
inlineinherited |
Definition at line 67 of file kicad_differ.h.
References m_options.
|
static |
Convenience: load a .kicad_sym path into a SYMBOL_MAP using SCH_IO_KICAD_SEXPR::EnumerateSymbolLib.
Symbol ownership is held by the returned vector; the caller must not delete entries individually.
Definition at line 50 of file sym_lib_differ.cpp.
References SCH_IO_KICAD_SEXPR::EnumerateSymbolLib().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SYMBOL_EDITOR_CONTROL::CompareLibraryWithFile(), loadSymbolLibrarySide(), and EESCHEMA_JOBS_HANDLER::runSymLibMerge().
|
inlineinherited |
Definition at line 66 of file kicad_differ.h.
References m_options.
|
private |
Definition at line 75 of file sym_lib_differ.h.
Referenced by Diff(), and SYM_LIB_DIFFER().
|
private |
Definition at line 74 of file sym_lib_differ.h.
Referenced by Diff(), and SYM_LIB_DIFFER().
|
protectedinherited |
Definition at line 80 of file kicad_differ.h.
Referenced by KICAD_DIFF::FP_LIB_DIFFER::Diff(), KICAD_DIFF::PCB_DIFFER::Diff(), KICAD_DIFF::SCH_DIFFER::Diff(), KICAD_DIFF::SYM_LIB_DIFFER::Diff(), KICAD_DIFF::PCB_DIFFER::diffFootprintChildren(), GetOptions(), and SetOptions().
|
private |
Definition at line 76 of file sym_lib_differ.h.
Referenced by Diff(), and SYM_LIB_DIFFER().