|
KiCad PCB EDA Suite
|
#include <library_table.h>
Public Member Functions | |
| LIBRARY_TABLE (const wxFileName &aPath, LIBRARY_TABLE_SCOPE aScope) | |
| Creates a library table from a file on disk. | |
| LIBRARY_TABLE (const wxString &aBuffer, LIBRARY_TABLE_SCOPE aScope) | |
| Creates a library table from parsed text. | |
| ~LIBRARY_TABLE ()=default | |
| bool | operator== (const LIBRARY_TABLE &aOther) const |
| LIBRARY_TABLE_ROW | MakeRow () const |
| Builds a new row that is suitable for this table (does not insert it) | |
| LIBRARY_TABLE_ROW & | InsertRow () |
| Builds a new row and inserts it at the end of the table; returning a reference to the row. | |
| const wxString & | Path () const |
| void | SetPath (const wxString &aPath) |
| LIBRARY_TABLE_TYPE | Type () const |
| void | SetType (const LIBRARY_TABLE_TYPE aType) |
| void | SetScope (LIBRARY_TABLE_SCOPE aScope) |
| LIBRARY_TABLE_SCOPE | Scope () const |
| std::optional< int > | Version () const |
| void | SetVersion (const std::optional< int > &aVersion) |
| bool | IsOk () const |
| const wxString & | ErrorDescription () const |
| const std::vector< LIBRARY_TABLE_ROW > & | Rows () const |
| std::vector< LIBRARY_TABLE_ROW > & | Rows () |
| void | Format (OUTPUTFORMATTER *aOutput) const |
| bool | HasRow (const wxString &aNickname) const |
| bool | HasRowWithURI (const wxString &aUri, const PROJECT &aProject, bool aSubstituted=false) const |
| Returns true if the given (fully-expanded) URI exists as a library in this table. | |
| std::optional< LIBRARY_TABLE_ROW * > | Row (const wxString &aNickname) |
| std::optional< const LIBRARY_TABLE_ROW * > | Row (const wxString &aNickname) const |
| LIBRARY_RESULT< void > | Save () |
Static Public Member Functions | |
| static std::map< std::string, UTF8 > | ParseOptions (const std::string &aOptionsList) |
| static UTF8 | FormatOptions (const std::map< std::string, UTF8 > *aProperties) |
Private Member Functions | |
| bool | initFromIR (const LIBRARY_TABLE_IR &aIR) |
| bool | addRowFromIR (const LIBRARY_TABLE_ROW_IR &aIR) |
Private Attributes | |
| wxString | m_path |
| The full path to the file this table was parsed from, if any. | |
| LIBRARY_TABLE_SCOPE | m_scope = LIBRARY_TABLE_SCOPE::UNINITIALIZED |
| LIBRARY_TABLE_TYPE | m_type = LIBRARY_TABLE_TYPE::UNINITIALIZED |
| What type of content this table contains (footprint, symbol, design block, etc) | |
| std::optional< int > | m_version |
| The format version, if present in the parsed file. | |
| bool | m_ok = false |
| wxString | m_errorDescription |
| std::vector< LIBRARY_TABLE_ROW > | m_rows |
Definition at line 131 of file library_table.h.
| LIBRARY_TABLE::LIBRARY_TABLE | ( | const wxFileName & | aPath, |
| LIBRARY_TABLE_SCOPE | aScope ) |
Creates a library table from a file on disk.
| aPath | is the path to a library table file to parse |
| aScope | is the scope of this table (is it global or part of a project) |
Definition at line 55 of file library_table.cpp.
References _, initFromIR(), m_errorDescription, m_ok, m_path, m_scope, LIBRARY_TABLE_PARSER::Parse(), and WX_FILENAME::ResolvePossibleSymlinks().
Referenced by operator==(), and ~LIBRARY_TABLE().
| LIBRARY_TABLE::LIBRARY_TABLE | ( | const wxString & | aBuffer, |
| LIBRARY_TABLE_SCOPE | aScope ) |
Creates a library table from parsed text.
| aBuffer | is a string containing data to parse |
| aScope | is the scope of this table (is it global or part of a project) |
Definition at line 86 of file library_table.cpp.
References m_path, m_scope, and LIBRARY_TABLE_PARSER::ParseBuffer().
|
default |
References InsertRow(), LIBRARY_TABLE(), and MakeRow().
|
private |
Definition at line 137 of file library_table.cpp.
References LIBRARY_TABLE_ROW_IR::description, LIBRARY_TABLE_ROW_IR::disabled, LIBRARY_TABLE_ROW_IR::hidden, LIBRARY_TABLE_ROW::m_description, LIBRARY_TABLE_ROW::m_disabled, LIBRARY_TABLE_ROW::m_hidden, LIBRARY_TABLE_ROW::m_nickname, LIBRARY_TABLE_ROW::m_ok, LIBRARY_TABLE_ROW::m_options, m_rows, m_scope, LIBRARY_TABLE_ROW::m_scope, LIBRARY_TABLE_ROW::m_type, LIBRARY_TABLE_ROW::m_uri, LIBRARY_TABLE_ROW_IR::nickname, LIBRARY_TABLE_ROW_IR::options, LIBRARY_TABLE_ROW_IR::type, and LIBRARY_TABLE_ROW_IR::uri.
Referenced by initFromIR().
|
inline |
Definition at line 171 of file library_table.h.
References m_errorDescription.
| void LIBRARY_TABLE::Format | ( | OUTPUTFORMATTER * | aOutput | ) | const |
Definition at line 156 of file library_table.cpp.
References XNODE::AddAttribute(), DESIGN_BLOCK, FOOTPRINT, XNODE::Format(), Rows(), SYMBOL, and Type().
Referenced by Save().
Definition at line 352 of file library_table.cpp.
References UTF8::begin(), UTF8::end(), name, OPT_SEP, and UTF8::size().
Referenced by DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow().
| bool LIBRARY_TABLE::HasRow | ( | const wxString & | aNickname | ) | const |
Definition at line 213 of file library_table.cpp.
References m_rows.
Referenced by PCM_LIB_TRAVERSER::ensureUnique().
| bool LIBRARY_TABLE::HasRowWithURI | ( | const wxString & | aUri, |
| const PROJECT & | aProject, | ||
| bool | aSubstituted = false ) const |
Returns true if the given (fully-expanded) URI exists as a library in this table.
| aSubstituted | is true if the URI should be compared with full (expanded/substituted) versions of the row URIs |
Definition at line 225 of file library_table.cpp.
References LIBRARY_MANAGER::ExpandURI(), m_rows, and PROJECT.
Referenced by PCM_LIB_TRAVERSER::addRowIfNecessary().
|
private |
Definition at line 117 of file library_table.cpp.
References addRowFromIR(), m_type, m_version, LIBRARY_TABLE_IR::rows, LIBRARY_TABLE_IR::type, and LIBRARY_TABLE_IR::version.
Referenced by LIBRARY_TABLE().
| LIBRARY_TABLE_ROW & LIBRARY_TABLE::InsertRow | ( | ) |
Builds a new row and inserts it at the end of the table; returning a reference to the row.
Definition at line 207 of file library_table.cpp.
References MakeRow(), and Rows().
Referenced by PCM_LIB_TRAVERSER::addRowIfNecessary(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::LoadSheetFromFile(), SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary(), and ~LIBRARY_TABLE().
|
inline |
Definition at line 170 of file library_table.h.
References m_ok.
Referenced by LIBRARY_MANAGER::IsTableValid(), and LIB_TABLE_GRID_TRICKS::paste_text().
| LIBRARY_TABLE_ROW LIBRARY_TABLE::MakeRow | ( | ) | const |
Builds a new row that is suitable for this table (does not insert it)
Definition at line 196 of file library_table.cpp.
References m_scope, LIBRARY_TABLE_ROW::SetOk(), and LIBRARY_TABLE_ROW::SetScope().
Referenced by InsertRow(), and ~LIBRARY_TABLE().
| bool LIBRARY_TABLE::operator== | ( | const LIBRARY_TABLE & | aOther | ) | const |
Definition at line 107 of file library_table.cpp.
References LIBRARY_TABLE(), m_path, m_rows, m_scope, m_type, and m_version.
|
static |
Definition at line 289 of file library_table.cpp.
References end, name, and OPT_SEP.
Referenced by LIBRARY_TABLE_ROW::GetOptionsMap(), PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries(), PANEL_DESIGN_BLOCK_LIB_TABLE::onMigrateLibraries(), PANEL_FP_LIB_TABLE::onMigrateLibraries(), and DIALOG_PLUGIN_OPTIONS::TransferDataToWindow().
|
inline |
Definition at line 158 of file library_table.h.
References m_path.
Referenced by PANEL_FP_LIB_TABLE::AddTable(), Save(), and LIB_TABLE_NOTEBOOK_PANEL::TableModified().
| std::optional< LIBRARY_TABLE_ROW * > LIBRARY_TABLE::Row | ( | const wxString & | aNickname | ) |
Definition at line 241 of file library_table.cpp.
References m_rows.
Referenced by SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().
| std::optional< const LIBRARY_TABLE_ROW * > LIBRARY_TABLE::Row | ( | const wxString & | aNickname | ) | const |
Definition at line 253 of file library_table.cpp.
References m_rows.
|
inline |
Definition at line 174 of file library_table.h.
References m_rows.
|
inline |
Definition at line 173 of file library_table.h.
References m_rows.
Referenced by DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), Format(), InsertRow(), LIB_TABLE_GRID_TRICKS::MoveDownHandler(), LIB_TABLE_GRID_TRICKS::MoveUpHandler(), and LIB_TABLE_GRID_TRICKS::paste_text().
| LIBRARY_RESULT< void > LIBRARY_TABLE::Save | ( | ) |
Definition at line 265 of file library_table.cpp.
References FN_NORMALIZE_FLAGS, Format(), Path(), traceLibraries, and IO_ERROR::What().
Referenced by DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDITOR_CONTROL::ExportSymbolsToLibrary(), SCH_EDIT_FRAME::LoadSheetFromFile(), LIB_TABLE_NOTEBOOK_PANEL::SaveTable(), PANEL_DESIGN_BLOCK_LIB_TABLE::TransferDataFromWindow(), PANEL_FP_LIB_TABLE::TransferDataFromWindow(), PANEL_SYM_LIB_TABLE::TransferDataFromWindow(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().
|
inline |
Definition at line 165 of file library_table.h.
References m_scope.
Referenced by LIBRARY_MANAGER::loadNestedTables(), and LIB_TABLE_GRID_TRICKS::paste_text().
|
inline |
Definition at line 159 of file library_table.h.
References m_path.
|
inline |
Definition at line 164 of file library_table.h.
References m_scope.
|
inline |
Definition at line 162 of file library_table.h.
References m_type.
|
inline |
Definition at line 168 of file library_table.h.
References m_version.
|
inline |
|
inline |
Definition at line 167 of file library_table.h.
References m_version.
|
private |
Definition at line 212 of file library_table.h.
Referenced by ErrorDescription(), and LIBRARY_TABLE().
|
private |
Definition at line 211 of file library_table.h.
Referenced by IsOk(), and LIBRARY_TABLE().
|
private |
The full path to the file this table was parsed from, if any.
Definition at line 201 of file library_table.h.
Referenced by LIBRARY_TABLE(), LIBRARY_TABLE(), operator==(), Path(), and SetPath().
|
private |
Definition at line 214 of file library_table.h.
Referenced by addRowFromIR(), HasRow(), HasRowWithURI(), operator==(), Row(), Row(), Rows(), and Rows().
|
private |
Definition at line 203 of file library_table.h.
Referenced by addRowFromIR(), LIBRARY_TABLE(), LIBRARY_TABLE(), MakeRow(), operator==(), Scope(), and SetScope().
|
private |
What type of content this table contains (footprint, symbol, design block, etc)
Definition at line 206 of file library_table.h.
Referenced by initFromIR(), operator==(), SetType(), and Type().
|
private |
The format version, if present in the parsed file.
Definition at line 209 of file library_table.h.
Referenced by initFromIR(), operator==(), SetVersion(), and Version().