|
KiCad PCB EDA Suite
|
#include <pcb_io_kicad_sexpr.h>
Public Member Functions | |
| FP_CACHE (PCB_IO_KICAD_SEXPR *aOwner, const wxString &aLibraryPath) | |
| wxString | GetPath () const |
| bool | IsWritable () const |
| bool | Exists () const |
| boost::ptr_map< wxString, FP_CACHE_ENTRY > & | GetFootprints () |
| void | Save (FOOTPRINT *aFootprintFilter=nullptr) |
| Save the footprint cache or a single footprint from it to disk. | |
| void | Load () |
| void | Remove (const wxString &aFootprintName) |
| bool | IsModified () |
| Return true if the cache is not up-to-date. | |
| bool | IsPath (const wxString &aPath) const |
| Check if aPath is the same as the current cache path. | |
| void | SetPath (const wxString &aPath) |
Static Public Member Functions | |
| static long long | GetTimestamp (const wxString &aLibPath) |
| Generate a timestamp representing all source files in the cache (including the parent directory). | |
Private Attributes | |
| PCB_IO_KICAD_SEXPR * | m_owner |
| wxFileName | m_lib_path |
| wxString | m_lib_raw_path |
| boost::ptr_map< wxString, FP_CACHE_ENTRY > | m_footprints |
| bool | m_cache_dirty |
| long long | m_cache_timestamp |
Definition at line 287 of file pcb_io_kicad_sexpr.h.
| FP_CACHE::FP_CACHE | ( | PCB_IO_KICAD_SEXPR * | aOwner, |
| const wxString & | aLibraryPath ) |
Definition at line 87 of file pcb_io_kicad_sexpr.cpp.
References m_cache_dirty, m_cache_timestamp, m_lib_path, m_lib_raw_path, and m_owner.
|
inline |
Definition at line 308 of file pcb_io_kicad_sexpr.h.
References m_lib_path.
|
inline |
Definition at line 310 of file pcb_io_kicad_sexpr.h.
References m_footprints.
Referenced by PCBNEW_JOBS_HANDLER::JobExportFpSvg(), PCBNEW_JOBS_HANDLER::JobExportFpUpgrade(), and SetPath().
|
inline |
Definition at line 304 of file pcb_io_kicad_sexpr.h.
References m_lib_raw_path.
|
static |
Generate a timestamp representing all source files in the cache (including the parent directory).
Timestamps should not be considered ordered. They either match or they don't.
Definition at line 256 of file pcb_io_kicad_sexpr.cpp.
References FILEEXT::KiCadFootprintFileExtension, and KIPLATFORM::IO::TimestampDir().
Referenced by PCB_IO_KICAD_SEXPR::GetLibraryTimestamp(), IsModified(), and Load().
| bool FP_CACHE::IsModified | ( | ) |
Return true if the cache is not up-to-date.
Definition at line 248 of file pcb_io_kicad_sexpr.cpp.
References GetTimestamp(), m_cache_dirty, m_cache_timestamp, and m_lib_path.
| bool FP_CACHE::IsPath | ( | const wxString & | aPath | ) | const |
Check if aPath is the same as the current cache path.
This tests paths by converting aPath using the native separators. Internally FP_CACHE stores the current path using native separators. This prevents path miscompares on Windows due to the fact that paths can be stored with / instead of \ in the footprint library table.
| aPath | is the library path to test against. |
Definition at line 231 of file pcb_io_kicad_sexpr.cpp.
References m_lib_raw_path.
|
inline |
Definition at line 306 of file pcb_io_kicad_sexpr.h.
References m_lib_path.
| void FP_CACHE::Load | ( | ) |
Definition at line 143 of file pcb_io_kicad_sexpr.cpp.
References _, WX_FILENAME::GetFullPath(), WX_FILENAME::GetName(), PCB_IO_KICAD_SEXPR_PARSER::GetParseWarnings(), GetTimestamp(), FILEEXT::KiCadFootprintFileExtension, m_cache_dirty, m_cache_timestamp, m_footprints, m_lib_raw_path, PCB_IO_KICAD_SEXPR_PARSER::ParseFootprintLib(), FOOTPRINT::SetFPID(), WX_FILENAME::SetFullName(), THROW_IO_ERROR, THROW_IO_ERRORF, traceKicadPcbPlugin, and IO_ERROR::What().
Referenced by PCBNEW_JOBS_HANDLER::JobExportFpSvg(), and PCBNEW_JOBS_HANDLER::JobExportFpUpgrade().
| void FP_CACHE::Remove | ( | const wxString & | aFootprintName | ) |
Definition at line 213 of file pcb_io_kicad_sexpr.cpp.
References _, m_footprints, m_lib_raw_path, and THROW_IO_ERRORF.
| void FP_CACHE::Save | ( | FOOTPRINT * | aFootprintFilter = nullptr | ) |
Save the footprint cache or a single footprint from it to disk.
| aFootprintFilter | if set, save only this footprint, otherwise, save the full library |
Definition at line 97 of file pcb_io_kicad_sexpr.cpp.
References _, PRETTIFIED_FILE_OUTPUTFORMATTER::Finish(), FP_CACHE_ENTRY::GetFileName(), FP_CACHE_ENTRY::GetFootprint(), WX_FILENAME::GetFullPath(), WX_FILENAME::GetTimestamp(), m_cache_dirty, m_cache_timestamp, m_footprints, m_lib_path, m_lib_raw_path, m_owner, THROW_IO_ERRORF, and traceKicadPcbPlugin.
Referenced by PCBNEW_JOBS_HANDLER::JobExportFpUpgrade().
| void FP_CACHE::SetPath | ( | const wxString & | aPath | ) |
Definition at line 237 of file pcb_io_kicad_sexpr.cpp.
References GetFootprints(), m_lib_path, and m_lib_raw_path.
Referenced by PCBNEW_JOBS_HANDLER::JobExportFpUpgrade().
|
private |
Definition at line 296 of file pcb_io_kicad_sexpr.h.
Referenced by FP_CACHE(), IsModified(), Load(), and Save().
|
private |
Definition at line 298 of file pcb_io_kicad_sexpr.h.
Referenced by FP_CACHE(), IsModified(), Load(), and Save().
|
private |
Definition at line 293 of file pcb_io_kicad_sexpr.h.
Referenced by GetFootprints(), Load(), Remove(), and Save().
|
private |
Definition at line 290 of file pcb_io_kicad_sexpr.h.
Referenced by Exists(), FP_CACHE(), IsModified(), IsWritable(), Save(), and SetPath().
|
private |
Definition at line 291 of file pcb_io_kicad_sexpr.h.
Referenced by FP_CACHE(), GetPath(), IsPath(), Load(), Remove(), Save(), and SetPath().
|
private |
Definition at line 289 of file pcb_io_kicad_sexpr.h.
Referenced by FP_CACHE(), and Save().