KiCad PCB EDA Suite
|
Public Member Functions | |
GPCB_FPL_CACHE (PCB_IO_GEDA *aOwner, const wxString &aLibraryPath) | |
wxString | GetPath () const |
bool | IsWritable () const |
FOOTPRINT_MAP & | GetFootprints () |
void | Load () |
Save not implemented for the Geda PCB footprint library format. | |
void | Remove (const wxString &aFootprintName) |
bool | IsModified () |
Return true if the cache is not up-to-date. | |
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 Member Functions | |
FOOTPRINT * | parseFOOTPRINT (LINE_READER *aLineReader) |
bool | testFlags (const wxString &aFlag, long aMask, const wxChar *aName) |
Test aFlag for aMask or aName. | |
void | parseParameters (wxArrayString &aParameterList, LINE_READER *aLineReader) |
Extract parameters and tokens from aLineReader and adds them to aParameterList. | |
Private Attributes | |
PCB_IO_GEDA * | m_owner |
Plugin object that owns the cache. | |
wxFileName | m_lib_path |
The path of the library. | |
FOOTPRINT_MAP | m_footprints |
Map of footprint file name to FOOTPRINT*. | |
bool | m_cache_dirty |
Stored separately because it's expensive to check m_cache_timestamp against all the files. | |
long long | m_cache_timestamp |
A hash of the timestamps for all the footprint files. | |
Definition at line 134 of file pcb_io_geda.cpp.
GPCB_FPL_CACHE::GPCB_FPL_CACHE | ( | PCB_IO_GEDA * | aOwner, |
const wxString & | aLibraryPath | ||
) |
Definition at line 209 of file pcb_io_geda.cpp.
References m_cache_dirty, m_cache_timestamp, m_lib_path, and m_owner.
|
inline |
Definition at line 141 of file pcb_io_geda.cpp.
References m_footprints.
Referenced by PCB_IO_GEDA::FootprintEnumerate(), and PCB_IO_GEDA::getFootprint().
|
inline |
Definition at line 139 of file pcb_io_geda.cpp.
References m_lib_path.
Referenced by PCB_IO_GEDA::DeleteLibrary().
|
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 304 of file pcb_io_geda.cpp.
References FILEEXT::GedaPcbFootprintLibFileExtension, and TimestampDir().
Referenced by PCB_IO_GEDA::GetLibraryTimestamp(), and IsModified().
bool GPCB_FPL_CACHE::IsModified | ( | ) |
Return true if the cache is not up-to-date.
Definition at line 296 of file pcb_io_geda.cpp.
References GetTimestamp(), m_cache_dirty, m_cache_timestamp, and m_lib_path.
Referenced by PCB_IO_GEDA::validateCache().
|
inline |
Definition at line 140 of file pcb_io_geda.cpp.
References m_lib_path.
Referenced by PCB_IO_GEDA::FootprintDelete(), and PCB_IO_GEDA::IsLibraryWritable().
void GPCB_FPL_CACHE::Load | ( | ) |
Save not implemented for the Geda PCB footprint library format.
Definition at line 218 of file pcb_io_geda.cpp.
References _, FILEEXT::GedaPcbFootprintLibFileExtension, WX_FILENAME::GetFullPath(), WX_FILENAME::GetName(), m_cache_dirty, m_cache_timestamp, m_footprints, m_lib_path, name, parseFOOTPRINT(), FOOTPRINT::SetFPID(), WX_FILENAME::SetFullName(), THROW_IO_ERROR, TO_UTF8, and IO_ERROR::What().
Referenced by PCB_IO_GEDA::validateCache().
|
private |
Definition at line 312 of file pcb_io_geda.cpp.
References _, PADSTACK::ALL_LAYERS, LSET::AllCuMask(), ANGLE_180, ANGLE_360, B_Cu, B_Mask, B_Paste, delta, F_Cu, F_Mask, F_Paste, F_SilkS, LINE_READER::GetSource(), LINE_READER::LineNumber(), PCB_SHAPE::Move(), NEW_GPCB_UNIT_CONV, OLD_GPCB_UNIT_CONV, pad, parseInt(), parseParameters(), RADIANS_T, LINE_READER::ReadLine(), PCB_SHAPE::Rotate(), RotatePoint(), EDA_SHAPE::SetArcAngleAndEnd(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetShape(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), TENTHS_OF_A_DEGREE_T, testFlags(), THROW_IO_ERROR, THROW_PARSE_ERROR, and traceGedaPcbPlugin.
Referenced by Load().
|
private |
Extract parameters and tokens from aLineReader and adds them to aParameterList.
Delimiter characters are: [ ] ( ) Begin and end of parameter list and units indicator " is a string delimiter space is the param separator The first word is the keyword the second item is one of ( or [ other are parameters (number or delimited string) last parameter is ) or ]
aParameterList | This list of parameters parsed. |
aLineReader | The line reader object to parse. |
Definition at line 673 of file pcb_io_geda.cpp.
References dump(), KI_FALLTHROUGH, LINE_READER::Line(), LINE_READER::ReadLine(), and traceGedaPcbPlugin.
Referenced by parseFOOTPRINT().
void GPCB_FPL_CACHE::Remove | ( | const wxString & | aFootprintName | ) |
Definition at line 276 of file pcb_io_geda.cpp.
References _, m_footprints, m_lib_path, THROW_IO_ERROR, and TO_UTF8.
Referenced by PCB_IO_GEDA::FootprintDelete().
|
private |
Test aFlag for aMask or aName.
aFlag | is a list of flags to test against: can be a bit field flag or a list name flag a bit field flag is an hexadecimal value: Ox00020000 a list name flag is a string list of flags, comma separated like square,option1. |
aMask | is the flag list to test. |
aName | is the flag name to find in list. |
Definition at line 779 of file pcb_io_geda.cpp.
Referenced by parseFOOTPRINT().
|
private |
Stored separately because it's expensive to check m_cache_timestamp against all the files.
Definition at line 202 of file pcb_io_geda.cpp.
Referenced by GPCB_FPL_CACHE(), IsModified(), and Load().
|
private |
A hash of the timestamps for all the footprint files.
Definition at line 204 of file pcb_io_geda.cpp.
Referenced by GPCB_FPL_CACHE(), IsModified(), and Load().
|
private |
Map of footprint file name to FOOTPRINT*.
Definition at line 200 of file pcb_io_geda.cpp.
Referenced by GetFootprints(), Load(), and Remove().
|
private |
The path of the library.
Definition at line 199 of file pcb_io_geda.cpp.
Referenced by GetPath(), GPCB_FPL_CACHE(), IsModified(), IsWritable(), Load(), and Remove().
|
private |
Plugin object that owns the cache.
Definition at line 198 of file pcb_io_geda.cpp.
Referenced by GPCB_FPL_CACHE().