KiCad PCB EDA Suite
|
#include <symbol_library_manager.h>
Public Member Functions | |
LIB_BUFFER (const wxString &aLibrary) | |
bool | IsModified () const |
int | GetHash () const |
Return the working copy of a LIB_SYMBOL root object with specified alias. | |
LIB_SYMBOL * | GetSymbol (const wxString &aAlias) const |
Create a new buffer to store a symbol. LIB_BUFFER takes ownership of aCopy. | |
bool | CreateBuffer (std::unique_ptr< LIB_SYMBOL > aCopy, std::unique_ptr< SCH_SCREEN > aScreen) |
Update the buffered symbol with the contents of aCopy. | |
bool | UpdateBuffer (SYMBOL_BUFFER &aSymbolBuf, const LIB_SYMBOL &aCopy) |
bool | DeleteBuffer (const SYMBOL_BUFFER &aSymbolBuf) |
Delete the given symbol buffer from the library buffer. | |
void | ClearDeletedBuffer () |
Save stored modifications using a plugin. | |
bool | SaveBuffer (SYMBOL_BUFFER &aSymbolBuf, const wxString &aFileName, SCH_IO *aPlugin, bool aBuffer) |
Return a symbol buffer with LIB_SYMBOL holding a symbolicular alias. | |
std::shared_ptr< SYMBOL_BUFFER > | GetBuffer (const wxString &aAlias) const |
Return all buffered symbols. | |
const std::deque< std::shared_ptr< SYMBOL_BUFFER > > & | GetBuffers () const |
bool | HasDerivedSymbols (const wxString &aParentName) const |
Check to see any symbols in the buffer are derived from a parent named aParentName. | |
void | GetSymbolNames (wxArrayString &aSymbolNames, SYMBOL_NAME_FILTER aFilter=SYMBOL_NAME_FILTER::ALL) |
Fetch a list of root symbols names from the library buffer. | |
size_t | GetDerivedSymbolNames (const wxString &aSymbolName, wxArrayString &aList) |
Fetch all of the symbols derived from a aSymbolName into aList. | |
Private Member Functions | |
int | removeChildSymbols (const SYMBOL_BUFFER &aSymbolBuf) |
Remove all symbols derived from aParent from the library buffer. | |
Private Attributes | |
std::deque< std::shared_ptr< SYMBOL_BUFFER > > | m_symbols |
std::deque< std::shared_ptr< SYMBOL_BUFFER > > | m_deleted |
Buffer for deleted symbols until library is saved. | |
const wxString | m_libName |
Buffered library name. | |
int | m_hash |
Definition at line 81 of file symbol_library_manager.h.
|
inline |
Definition at line 84 of file symbol_library_manager.h.
|
inline |
Save stored modifications using a plugin.
aBuffer decides whether the changes should be cached or stored directly to the disk (for SCH_IO_KICAD_LEGACY).
Definition at line 119 of file symbol_library_manager.h.
References m_deleted.
Referenced by SYMBOL_LIBRARY_MANAGER::SaveLibrary().
bool LIB_BUFFER::CreateBuffer | ( | std::unique_ptr< LIB_SYMBOL > | aCopy, |
std::unique_ptr< SCH_SCREEN > | aScreen | ||
) |
Update the buffered symbol with the contents of aCopy.
Definition at line 943 of file symbol_library_manager.cpp.
References m_hash, m_libName, m_symbols, and LIB_ID::SetLibNickname().
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbol().
bool LIB_BUFFER::DeleteBuffer | ( | const SYMBOL_BUFFER & | aSymbolBuf | ) |
Delete the given symbol buffer from the library buffer.
Definition at line 975 of file symbol_library_manager.cpp.
References LIB_SYMBOL::GetName(), SYMBOL_BUFFER::GetSymbol(), HasDerivedSymbols(), m_deleted, m_hash, m_symbols, and removeChildSymbols().
Referenced by BOOST_AUTO_TEST_CASE(), and SYMBOL_LIBRARY_MANAGER::RemoveSymbol().
std::shared_ptr< SYMBOL_BUFFER > LIB_BUFFER::GetBuffer | ( | const wxString & | aAlias | ) | const |
Return all buffered symbols.
Definition at line 1165 of file symbol_library_manager.cpp.
References m_symbols.
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_LIBRARY_MANAGER::GetScreen(), GetSymbol(), SYMBOL_LIBRARY_MANAGER::IsSymbolModified(), SYMBOL_LIBRARY_MANAGER::RemoveSymbol(), SaveBuffer(), SYMBOL_LIBRARY_MANAGER::SetSymbolModified(), SYMBOL_LIBRARY_MANAGER::UpdateSymbol(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbolAfterRename().
|
inline |
Definition at line 130 of file symbol_library_manager.h.
References m_symbols.
Referenced by BOOST_AUTO_TEST_CASE(), and SYMBOL_LIBRARY_MANAGER::SaveLibrary().
size_t LIB_BUFFER::GetDerivedSymbolNames | ( | const wxString & | aSymbolName, |
wxArrayString & | aList | ||
) |
Fetch all of the symbols derived from a aSymbolName into aList.
aSymbolName | is the name of the symbol to search for derived symbols in this buffer. |
aList | is the list of symbols names derived from aSymbolName. |
Definition at line 1212 of file symbol_library_manager.cpp.
References GetDerivedSymbolNames(), LIB_SYMBOL::GetName(), LIB_SYMBOL::GetParent(), LIB_SYMBOL::IsAlias(), and m_symbols.
Referenced by BOOST_AUTO_TEST_CASE(), GetDerivedSymbolNames(), removeChildSymbols(), and SaveBuffer().
|
inline |
Return the working copy of a LIB_SYMBOL root object with specified alias.
Definition at line 103 of file symbol_library_manager.h.
References m_hash.
Referenced by BOOST_AUTO_TEST_CASE().
LIB_SYMBOL * LIB_BUFFER::GetSymbol | ( | const wxString & | aAlias | ) | const |
Create a new buffer to store a symbol. LIB_BUFFER takes ownership of aCopy.
Definition at line 931 of file symbol_library_manager.cpp.
References GetBuffer().
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), and SYMBOL_LIBRARY_MANAGER::getLibraryBuffer().
void LIB_BUFFER::GetSymbolNames | ( | wxArrayString & | aSymbolNames, |
SYMBOL_NAME_FILTER | aFilter = SYMBOL_NAME_FILTER::ALL |
||
) |
Fetch a list of root symbols names from the library buffer.
aRootSymbolNames | is a reference to a list to populate with root symbol names. |
aFilter | is the symbol derivation type. |
Definition at line 1197 of file symbol_library_manager.cpp.
References LIB_SYMBOL::GetName(), LIB_SYMBOL::IsAlias(), LIB_SYMBOL::IsRoot(), m_symbols, and UnescapeString().
Referenced by BOOST_AUTO_TEST_CASE(), and SYMBOL_LIBRARY_MANAGER::GetSymbolNames().
bool LIB_BUFFER::HasDerivedSymbols | ( | const wxString & | aParentName | ) | const |
Check to see any symbols in the buffer are derived from a parent named aParentName.
aParentName | is the name of the parent to test. |
Definition at line 1177 of file symbol_library_manager.cpp.
References m_symbols.
Referenced by BOOST_AUTO_TEST_CASE(), DeleteBuffer(), and SYMBOL_LIBRARY_MANAGER::HasDerivedSymbols().
|
inline |
Definition at line 89 of file symbol_library_manager.h.
References m_deleted, and m_symbols.
Referenced by BOOST_AUTO_TEST_CASE().
|
private |
Remove all symbols derived from aParent from the library buffer.
aParent | is the SYMBOL_BUFFER to check against. |
Definition at line 1239 of file symbol_library_manager.cpp.
References GetDerivedSymbolNames(), LIB_SYMBOL::GetName(), SYMBOL_BUFFER::GetSymbol(), m_deleted, and m_symbols.
Referenced by DeleteBuffer().
bool LIB_BUFFER::SaveBuffer | ( | SYMBOL_BUFFER & | aSymbolBuf, |
const wxString & | aFileName, | ||
SCH_IO * | aPlugin, | ||
bool | aBuffer | ||
) |
Return a symbol buffer with LIB_SYMBOL holding a symbolicular alias.
Definition at line 1002 of file symbol_library_manager.cpp.
References _, SCH_IO::DeleteSymbol(), GetBuffer(), GetDerivedSymbolNames(), LIB_SYMBOL::GetName(), SYMBOL_BUFFER::GetOriginal(), LIB_SYMBOL::GetParent(), SYMBOL_BUFFER::GetSymbol(), LIB_SYMBOL::IsAlias(), SCH_IO::LoadSymbol(), m_hash, SCH_IO_KICAD_LEGACY::PropBuffering, SCH_IO::SaveSymbol(), SYMBOL_BUFFER::SetOriginal(), LIB_SYMBOL::SetParent(), UnescapeString(), and IO_ERROR::What().
Referenced by SYMBOL_LIBRARY_MANAGER::SaveLibrary().
bool LIB_BUFFER::UpdateBuffer | ( | SYMBOL_BUFFER & | aSymbolBuf, |
const LIB_SYMBOL & | aCopy | ||
) |
Definition at line 964 of file symbol_library_manager.cpp.
References SYMBOL_BUFFER::GetSymbol(), and m_hash.
Referenced by BOOST_AUTO_TEST_CASE(), and SYMBOL_LIBRARY_MANAGER::UpdateSymbolAfterRename().
|
private |
Buffer for deleted symbols until library is saved.
Definition at line 171 of file symbol_library_manager.h.
Referenced by ClearDeletedBuffer(), DeleteBuffer(), IsModified(), and removeChildSymbols().
|
private |
Definition at line 174 of file symbol_library_manager.h.
Referenced by CreateBuffer(), DeleteBuffer(), GetHash(), SaveBuffer(), and UpdateBuffer().
|
private |
Buffered library name.
Definition at line 173 of file symbol_library_manager.h.
Referenced by CreateBuffer().
|
private |
Definition at line 170 of file symbol_library_manager.h.
Referenced by CreateBuffer(), DeleteBuffer(), GetBuffer(), GetBuffers(), GetDerivedSymbolNames(), GetSymbolNames(), HasDerivedSymbols(), IsModified(), and removeChildSymbols().