KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sym_lib_differ.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 3 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef SYM_LIB_DIFFER_H
25#define SYM_LIB_DIFFER_H
26
28
29#include <wx/string.h>
30
31#include <map>
32
33
34class LIB_SYMBOL;
35
36
37namespace KICAD_DIFF
38{
39
55{
56public:
59 using SYMBOL_MAP = std::map<wxString, const LIB_SYMBOL*>;
60
61 SYM_LIB_DIFFER( const SYMBOL_MAP& aBefore, const SYMBOL_MAP& aAfter,
62 const wxString& aPath = wxEmptyString );
63 ~SYM_LIB_DIFFER() override;
64
65 DOCUMENT_DIFF Diff() override;
66
70 static std::pair<std::vector<std::unique_ptr<LIB_SYMBOL>>, SYMBOL_MAP>
71 LoadLibrary( const wxString& aPath );
72
73private:
76 wxString m_path;
77};
78
79} // namespace KICAD_DIFF
80
81#endif // SYM_LIB_DIFFER_H
const SYMBOL_MAP & m_before
SYM_LIB_DIFFER(const SYMBOL_MAP &aBefore, const SYMBOL_MAP &aAfter, const wxString &aPath=wxEmptyString)
const SYMBOL_MAP & m_after
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
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.
std::map< wxString, const LIB_SYMBOL * > SYMBOL_MAP
Library content is a map of (canonical_name -> LIB_SYMBOL*).
Define a library symbol object.
Definition lib_symbol.h:79
The full set of changes between two parsed documents of one type.