|
KiCad PCB EDA Suite
|
A library parsed once; items are then served by name without reading the file again. More...
#include <easypc_document.h>
Public Member Functions | |
| LIBRARY_FILE (const wxString &aPath) | |
| Throws IO_ERROR when the file is not a library or is malformed. | |
| FILE_KIND | Kind () const |
| const std::vector< wxString > & | ItemNames () const |
| Item names in directory order, unescaped. | |
| bool | HasItem (const wxString &aItemName) const |
| const std::vector< wxString > & | Warnings () const |
| Warnings for item names that collide after unescaping. | |
| std::unique_ptr< LIBRARY_ITEM > | LoadItem (const wxString &aItemName) const |
| Throws IO_ERROR if no item has that name. | |
Static Public Member Functions | |
| static long long | Timestamp (const wxString &aPath) |
| A library file's modification time, 0 when it does not exist. | |
Private Attributes | |
| wxString | m_path |
| COMPOUND_FILE | m_file |
| FILE_KIND | m_kind |
| int32_t | m_product = PRODUCT_EASYPC |
| std::vector< const SOURCE_FB_ENTRY * > | m_entries |
| std::vector< wxString > | m_names |
| std::map< wxString, size_t > | m_byName |
| std::vector< wxString > | m_warnings |
A library parsed once; items are then served by name without reading the file again.
Definition at line 90 of file easypc_document.h.
|
explicit |
Throws IO_ERROR when the file is not a library or is malformed.
Definition at line 174 of file easypc_document.cpp.
References _, EASYPC::COMPONENT_LIBRARY, EASYPC::FileKindString(), m_entries, m_file, m_kind, m_path, m_product, and THROW_IO_ERROR.
|
inline |
Definition at line 103 of file easypc_document.h.
References m_byName.
Referenced by PCB_IO_EASYPC::FootprintExists(), PCB_IO_EASYPC::GetEnumeratedFootprint(), and SCH_IO_EASYPC::LoadSymbol().
|
inline |
Item names in directory order, unescaped.
Definition at line 102 of file easypc_document.h.
References m_names.
|
inline |
Definition at line 99 of file easypc_document.h.
References m_kind.
Referenced by SCH_IO_EASYPC::LoadSymbol().
| std::unique_ptr< LIBRARY_ITEM > EASYPC::LIBRARY_FILE::LoadItem | ( | const wxString & | aItemName | ) | const |
Throws IO_ERROR if no item has that name.
Definition at line 230 of file easypc_document.cpp.
References _, EASYPC::COMPONENT, EASYPC::COMPONENT_LIBRARY, LoadItem(), m_byName, m_entries, m_file, m_kind, m_path, m_product, EASYPC::PCB_SYMBOL, EASYPC::PCB_SYMBOL_LIBRARY, EASYPC::ARCHIVE::ReadObject(), EASYPC::SCH_SYMBOL, EASYPC::ARCHIVE::TakeObjects(), THROW_IO_ERROR, and EASYPC::UnescapeItemName().
Referenced by SCH_IO_EASYPC::convertComponent(), PCB_IO_EASYPC::GetEnumeratedFootprint(), LoadItem(), and SCH_IO_EASYPC::LoadSymbol().
|
static |
A library file's modification time, 0 when it does not exist.
Definition at line 167 of file easypc_document.cpp.
Referenced by PCB_IO_EASYPC::GetLibraryTimestamp(), PCB_IO_EASYPC::library(), and SCH_IO_EASYPC::library().
|
inline |
Warnings for item names that collide after unescaping.
Definition at line 106 of file easypc_document.h.
References m_warnings.
|
private |
Definition at line 118 of file easypc_document.h.
Referenced by HasItem(), and LoadItem().
|
private |
Definition at line 116 of file easypc_document.h.
Referenced by LIBRARY_FILE(), and LoadItem().
|
private |
Definition at line 113 of file easypc_document.h.
Referenced by LIBRARY_FILE(), and LoadItem().
|
private |
Definition at line 114 of file easypc_document.h.
Referenced by Kind(), LIBRARY_FILE(), and LoadItem().
|
private |
Definition at line 117 of file easypc_document.h.
Referenced by ItemNames().
|
private |
Definition at line 112 of file easypc_document.h.
Referenced by LIBRARY_FILE(), and LoadItem().
|
private |
Definition at line 115 of file easypc_document.h.
Referenced by LIBRARY_FILE(), and LoadItem().
|
private |
Definition at line 119 of file easypc_document.h.
Referenced by Warnings().