KiCad PCB EDA Suite
|
A base cache assistant implementation for the symbol library portion of the SCH_PLUGIN API. More...
#include <sch_lib_plugin_cache.h>
Public Member Functions | |
SCH_LIB_PLUGIN_CACHE (const wxString &aLibraryPath) | |
virtual | ~SCH_LIB_PLUGIN_CACHE () |
void | IncrementModifyHash () |
int | GetModifyHash () |
virtual void | Save (const std::optional< bool > &aOpt=std::nullopt) |
Save the entire library to file m_libFileName;. More... | |
virtual void | Load ()=0 |
virtual void | AddSymbol (const LIB_SYMBOL *aSymbol) |
virtual void | DeleteSymbol (const wxString &aName)=0 |
virtual LIB_SYMBOL * | GetSymbol (const wxString &aName) |
wxFileName | GetRealFile () const |
wxDateTime | GetLibModificationTime () |
bool | IsFile (const wxString &aFullPathAndFileName) const |
bool | IsFileChanged () const |
void | SetModified (bool aModified=true) |
wxString | GetLogicalName () const |
void | SetFileName (const wxString &aFileName) |
wxString | GetFileName () const |
const LIB_SYMBOL_MAP & | GetSymbolMap () const |
Protected Member Functions | |
LIB_SYMBOL * | removeSymbol (LIB_SYMBOL *aAlias) |
Protected Attributes | |
int | m_modHash |
std::mutex | m_modHashMutex |
wxString | m_fileName |
wxFileName | m_libFileName |
wxDateTime | m_fileModTime |
LIB_SYMBOL_MAP | m_symbols |
bool | m_isWritable |
bool | m_isModified |
SCH_LIB_TYPE | m_libType |
A base cache assistant implementation for the symbol library portion of the SCH_PLUGIN API.
Definition at line 40 of file sch_lib_plugin_cache.h.
SCH_LIB_PLUGIN_CACHE::SCH_LIB_PLUGIN_CACHE | ( | const wxString & | aLibraryPath | ) |
Definition at line 28 of file sch_lib_plugin_cache.cpp.
References m_libType.
|
virtual |
Definition at line 39 of file sch_lib_plugin_cache.cpp.
References m_symbols.
|
virtual |
Definition at line 161 of file sch_lib_plugin_cache.cpp.
References LIB_SYMBOL::GetName(), IncrementModifyHash(), m_isModified, m_symbols, name, and removeSymbol().
Referenced by SCH_SEXPR_PLUGIN::SaveSymbol(), and SCH_LEGACY_PLUGIN::SaveSymbol().
|
pure virtual |
Implemented in SCH_SEXPR_PLUGIN_CACHE, and SCH_LEGACY_PLUGIN_CACHE.
|
inline |
Definition at line 88 of file sch_lib_plugin_cache.h.
References m_libFileName.
Referenced by SCH_SEXPR_PLUGIN::SaveLibrary(), and SCH_LEGACY_PLUGIN::SaveLibrary().
wxDateTime SCH_LIB_PLUGIN_CACHE::GetLibModificationTime | ( | ) |
Definition at line 65 of file sch_lib_plugin_cache.cpp.
References GetRealFile(), and m_isWritable.
Referenced by SCH_SEXPR_PLUGIN_CACHE::Load(), and SCH_LEGACY_PLUGIN_CACHE::Load().
|
inline |
Definition at line 84 of file sch_lib_plugin_cache.h.
References m_libFileName.
|
inline |
Definition at line 52 of file sch_lib_plugin_cache.h.
References m_modHash, and m_modHashMutex.
Referenced by SCH_SEXPR_PLUGIN::GetModifyHash(), and SCH_LEGACY_PLUGIN::GetModifyHash().
wxFileName SCH_LIB_PLUGIN_CACHE::GetRealFile | ( | ) | const |
Definition at line 55 of file sch_lib_plugin_cache.cpp.
References m_libFileName, and WX_FILENAME::ResolvePossibleSymlinks().
Referenced by GetLibModificationTime(), IsFileChanged(), SCH_LEGACY_PLUGIN_CACHE::Save(), and SCH_SEXPR_PLUGIN_CACHE::Save().
|
virtual |
Definition at line 178 of file sch_lib_plugin_cache.cpp.
References m_symbols.
Referenced by EESCHEMA_JOBS_HANDLER::JobSymExportSvg().
|
inline |
Definition at line 90 of file sch_lib_plugin_cache.h.
References m_symbols.
Referenced by EESCHEMA_JOBS_HANDLER::JobSymExportSvg().
|
inline |
Definition at line 46 of file sch_lib_plugin_cache.h.
References m_modHash, and m_modHashMutex.
Referenced by AddSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), SCH_LEGACY_PLUGIN_CACHE::Load(), and removeSymbol().
bool SCH_LIB_PLUGIN_CACHE::IsFile | ( | const wxString & | aFullPathAndFileName | ) | const |
Definition at line 77 of file sch_lib_plugin_cache.cpp.
References m_fileName.
Referenced by SCH_SEXPR_PLUGIN::cacheLib(), SCH_LEGACY_PLUGIN::cacheLib(), SCH_SEXPR_PLUGIN::DeleteSymbolLib(), SCH_LEGACY_PLUGIN::DeleteSymbolLib(), SCH_SEXPR_PLUGIN::SaveLibrary(), and SCH_LEGACY_PLUGIN::SaveLibrary().
bool SCH_LIB_PLUGIN_CACHE::IsFileChanged | ( | ) | const |
Definition at line 83 of file sch_lib_plugin_cache.cpp.
References GetRealFile(), and m_fileModTime.
Referenced by SCH_SEXPR_PLUGIN::cacheLib(), and SCH_LEGACY_PLUGIN::cacheLib().
|
pure virtual |
Implemented in ALTIUM_LIB_PLUGIN_CACHE, SCH_SEXPR_PLUGIN_CACHE, and SCH_LEGACY_PLUGIN_CACHE.
|
protected |
Definition at line 94 of file sch_lib_plugin_cache.cpp.
References LIB_SYMBOL::AddDrawItem(), EDA_ITEM::Clone(), LIB_SYMBOL::FindField(), LIB_FIELD::GetCanonicalName(), LIB_SYMBOL::GetDrawItems(), LIB_SYMBOL::GetName(), IncrementModifyHash(), LIB_SYMBOL::IsRoot(), LIB_FIELD_T, m_isModified, m_libFileName, m_symbols, EDA_ITEM::SetParent(), and LIB_SYMBOL::SharedPtr().
Referenced by AddSymbol().
|
virtual |
Save the entire library to file m_libFileName;.
Reimplemented in SCH_LEGACY_PLUGIN_CACHE, and SCH_SEXPR_PLUGIN_CACHE.
Definition at line 49 of file sch_lib_plugin_cache.cpp.
|
inline |
Definition at line 86 of file sch_lib_plugin_cache.h.
References m_libFileName.
Referenced by EESCHEMA_JOBS_HANDLER::JobSymUpgrade(), SCH_SEXPR_PLUGIN::SaveLibrary(), and SCH_LEGACY_PLUGIN::SaveLibrary().
|
inline |
Definition at line 82 of file sch_lib_plugin_cache.h.
References m_isModified.
Referenced by SCH_SEXPR_PLUGIN::CreateSymbolLib(), SCH_LEGACY_PLUGIN::CreateSymbolLib(), EESCHEMA_JOBS_HANDLER::JobSymUpgrade(), SCH_SEXPR_PLUGIN::SaveLibrary(), and SCH_LEGACY_PLUGIN::SaveLibrary().
|
protected |
Definition at line 100 of file sch_lib_plugin_cache.h.
Referenced by IsFileChanged(), SCH_SEXPR_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::Save(), and SCH_SEXPR_PLUGIN_CACHE::Save().
|
protected |
Definition at line 98 of file sch_lib_plugin_cache.h.
Referenced by IsFile().
|
protected |
Definition at line 103 of file sch_lib_plugin_cache.h.
Referenced by AddSymbol(), SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::Save(), SCH_SEXPR_PLUGIN_CACHE::Save(), and SetModified().
|
protected |
Definition at line 102 of file sch_lib_plugin_cache.h.
Referenced by GetLibModificationTime().
|
protected |
Definition at line 99 of file sch_lib_plugin_cache.h.
Referenced by SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), GetFileName(), GetLogicalName(), GetRealFile(), SCH_SEXPR_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::saveDocFile(), and SetFileName().
|
protected |
Definition at line 104 of file sch_lib_plugin_cache.h.
Referenced by SCH_LEGACY_PLUGIN_CACHE::Load(), and SCH_LIB_PLUGIN_CACHE().
|
protected |
Definition at line 95 of file sch_lib_plugin_cache.h.
Referenced by SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol(), GetModifyHash(), IncrementModifyHash(), and SCH_SEXPR_PLUGIN_CACHE::Load().
|
protected |
Definition at line 96 of file sch_lib_plugin_cache.h.
Referenced by GetModifyHash(), and IncrementModifyHash().
|
protected |
Definition at line 101 of file sch_lib_plugin_cache.h.
Referenced by AddSymbol(), SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), SCH_SEXPR_PLUGIN::EnumerateSymbolLib(), SCH_LEGACY_PLUGIN::EnumerateSymbolLib(), SCH_SEXPR_PLUGIN::GetAvailableSymbolFields(), GetSymbol(), GetSymbolMap(), SCH_SEXPR_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), SCH_SEXPR_PLUGIN::LoadSymbol(), SCH_LEGACY_PLUGIN::LoadSymbol(), removeSymbol(), SCH_LEGACY_PLUGIN_CACHE::Save(), SCH_SEXPR_PLUGIN_CACHE::Save(), SCH_LEGACY_PLUGIN_CACHE::saveDocFile(), and ~SCH_LIB_PLUGIN_CACHE().