|
KiCad PCB EDA Suite
|
Parses EasyEDA Pro v3 .epro2 archives. More...
#include <easyedapro_v3_parser.h>
Public Member Functions | |
| V3_DOC_PARSER (const wxString &aFileName) | |
| void | Load () |
| Load all v3 docs from the archive. | |
| void | LoadLibrary () |
| Load all v3 docs from a library archive. | |
| const nlohmann::json & | GetProject2 () const |
| const nlohmann::json & | GetLibraryIndex () const |
| const std::map< wxString, V3_DOC_RAW > & | GetRawDocs (const wxString &aDocType) const |
| const V3_DOC_RAW * | FindRawDoc (const wxString &aDocType, const wxString &aUuid) const |
| int | GetSkippedCount () const |
Static Public Member Functions | |
| static bool | IsV3Archive (const wxString &aFileName) |
| Return true if aFileName looks like an EasyEDA Pro v3 archive. | |
| static bool | IsV3Library (const wxString &aFileName, const wxString &aRequiredDocType=wxEmptyString) |
| Return true if aFileName looks like an EasyEDA Pro v3 library archive. | |
Private Attributes | |
| wxString | m_fileName |
| nlohmann::json | m_project2 |
| nlohmann::json | m_libraryIndex |
| std::map< wxString, std::map< wxString, V3_DOC_RAW > > | m_rawDocs |
| int | m_skippedCount = 0 |
Parses EasyEDA Pro v3 .epro2 archives.
Provides raw document access (GetRawDocs/FindRawDoc) for direct v3 parsing.
Definition at line 91 of file easyedapro_v3_parser.h.
|
explicit |
Definition at line 610 of file easyedapro_v3_parser.cpp.
References m_fileName.
| const V3_DOC_RAW * EASYEDAPRO::V3_DOC_PARSER::FindRawDoc | ( | const wxString & | aDocType, |
| const wxString & | aUuid ) const |
Definition at line 721 of file easyedapro_v3_parser.cpp.
References m_rawDocs.
Referenced by EASYEDAPRO::BuildV3SymbolLibraryMap(), PCB_IO_EASYEDAPRO_V3::LoadBoard(), and LoadV3LibrarySymbolItem().
|
inline |
Definition at line 131 of file easyedapro_v3_parser.h.
References m_libraryIndex.
Referenced by EASYEDAPRO::BuildV3LibraryItemMap(), EASYEDAPRO::BuildV3SymbolLibraryMap(), and LoadV3LibrarySymbolItem().
|
inline |
Definition at line 129 of file easyedapro_v3_parser.h.
References m_project2.
| const std::map< wxString, V3_DOC_RAW > & EASYEDAPRO::V3_DOC_PARSER::GetRawDocs | ( | const wxString & | aDocType | ) | const |
Definition at line 708 of file easyedapro_v3_parser.cpp.
References empty(), and m_rawDocs.
Referenced by EASYEDAPRO::BuildV3BlobMap(), EASYEDAPRO::BuildV3LibraryItemMap(), EASYEDAPRO::BuildV3ProjectIndexFromRawDocs(), and PCB_IO_EASYEDAPRO_V3::LoadBoard().
|
inline |
Definition at line 137 of file easyedapro_v3_parser.h.
References m_skippedCount.
Referenced by PCB_IO_EASYEDAPRO_V3::LoadBoard().
|
static |
Return true if aFileName looks like an EasyEDA Pro v3 archive.
Supported detection:
Definition at line 616 of file easyedapro_v3_parser.cpp.
References zip.
Referenced by PCB_IO_EASYEDAPRO_V3::CanReadBoard(), SCH_IO_EASYEDAPRO_V3::CanReadSchematicFile(), and IMPORT_PROJ_HELPER::ImportFiles().
|
static |
Return true if aFileName looks like an EasyEDA Pro v3 library archive.
Detection requires a .elibz2 extension with a ZIP containing symbol2.json, footprint2.json or device2.json and at least one .elibu document file. When aRequiredDocType is set, the .elibu document file must also contain that document type.
Definition at line 659 of file easyedapro_v3_parser.cpp.
Referenced by PCB_IO_EASYEDAPRO_V3::CanReadLibrary(), and SCH_IO_EASYEDAPRO_V3::CanReadLibrary().
| void EASYEDAPRO::V3_DOC_PARSER::Load | ( | ) |
Load all v3 docs from the archive.
| IO_ERROR | on malformed v3 archives or parse failures. |
Definition at line 678 of file easyedapro_v3_parser.cpp.
References m_fileName, m_libraryIndex, m_project2, m_rawDocs, and m_skippedCount.
Referenced by IMPORT_PROJ_HELPER::EasyEDAProProjectHandler(), and PCB_IO_EASYEDAPRO_V3::LoadBoard().
| void EASYEDAPRO::V3_DOC_PARSER::LoadLibrary | ( | ) |
Load all v3 docs from a library archive.
| IO_ERROR | on malformed v3 library archives or parse failures. |
Definition at line 694 of file easyedapro_v3_parser.cpp.
References m_fileName, m_libraryIndex, m_project2, m_rawDocs, and m_skippedCount.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
private |
Definition at line 140 of file easyedapro_v3_parser.h.
Referenced by Load(), LoadLibrary(), and V3_DOC_PARSER().
|
private |
Definition at line 142 of file easyedapro_v3_parser.h.
Referenced by GetLibraryIndex(), Load(), and LoadLibrary().
|
private |
Definition at line 141 of file easyedapro_v3_parser.h.
Referenced by GetProject2(), Load(), and LoadLibrary().
|
private |
Definition at line 143 of file easyedapro_v3_parser.h.
Referenced by FindRawDoc(), GetRawDocs(), Load(), and LoadLibrary().
|
private |
Definition at line 144 of file easyedapro_v3_parser.h.
Referenced by GetSkippedCount(), Load(), and LoadLibrary().