KiCad PCB EDA Suite
|
Public Member Functions | |
GPCB_FPL_CACHE (GPCB_PLUGIN *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. More... | |
void | Remove (const wxString &aFootprintName) |
bool | IsModified () |
Return true if the cache is not up-to-date. More... | |
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). More... | |
Private Member Functions | |
FOOTPRINT * | parseFOOTPRINT (LINE_READER *aLineReader) |
bool | testFlags (const wxString &aFlag, long aMask, const wxChar *aName) |
Test aFlag for aMask or aName. More... | |
void | parseParameters (wxArrayString &aParameterList, LINE_READER *aLineReader) |
Extract parameters and tokens from aLineReader and adds them to aParameterList. More... | |
Private Attributes | |
GPCB_PLUGIN * | m_owner |
Plugin object that owns the cache. More... | |
wxFileName | m_lib_path |
The path of the library. More... | |
FOOTPRINT_MAP | m_footprints |
Map of footprint file name to FOOTPRINT*. More... | |
bool | m_cache_dirty |
Stored separately because it's expensive to check m_cache_timestamp against all the files. More... | |
long long | m_cache_timestamp |
A hash of the timestamps for all the footprint files. More... | |
Definition at line 132 of file gpcb_plugin.cpp.
GPCB_FPL_CACHE::GPCB_FPL_CACHE | ( | GPCB_PLUGIN * | aOwner, |
const wxString & | aLibraryPath | ||
) |
Definition at line 207 of file gpcb_plugin.cpp.
References m_cache_dirty, m_cache_timestamp, m_lib_path, and m_owner.
|
inline |
Definition at line 139 of file gpcb_plugin.cpp.
References m_footprints.
Referenced by GPCB_PLUGIN::FootprintEnumerate(), and GPCB_PLUGIN::getFootprint().
|
inline |
Definition at line 137 of file gpcb_plugin.cpp.
References m_lib_path.
Referenced by GPCB_PLUGIN::FootprintLibDelete().
|
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 302 of file gpcb_plugin.cpp.
References GedaPcbFootprintLibFileExtension, and TimestampDir().
Referenced by GPCB_PLUGIN::GetLibraryTimestamp(), and IsModified().
bool GPCB_FPL_CACHE::IsModified | ( | ) |
Return true if the cache is not up-to-date.
Definition at line 294 of file gpcb_plugin.cpp.
References GetTimestamp(), m_cache_dirty, m_cache_timestamp, and m_lib_path.
Referenced by GPCB_PLUGIN::validateCache().
|
inline |
Definition at line 138 of file gpcb_plugin.cpp.
References m_lib_path.
Referenced by GPCB_PLUGIN::FootprintDelete(), and GPCB_PLUGIN::IsFootprintLibWritable().
void GPCB_FPL_CACHE::Load | ( | ) |
Save not implemented for the Geda PCB footprint library format.
Definition at line 216 of file gpcb_plugin.cpp.
References _, 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 GPCB_PLUGIN::validateCache().
|
private |
Definition at line 310 of file gpcb_plugin.cpp.
References _, LSET::AllCuMask(), ANGLE_180, ANGLE_360, B_Cu, B_Mask, B_Paste, delta, EuclideanNorm(), F_Cu, F_Mask, F_Paste, F_SilkS, LINE_READER::GetSource(), KiROUND(), 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 669 of file gpcb_plugin.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 274 of file gpcb_plugin.cpp.
References _, m_footprints, m_lib_path, THROW_IO_ERROR, and TO_UTF8.
Referenced by GPCB_PLUGIN::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 775 of file gpcb_plugin.cpp.
Referenced by parseFOOTPRINT().
|
private |
Stored separately because it's expensive to check m_cache_timestamp against all the files.
Definition at line 200 of file gpcb_plugin.cpp.
Referenced by GPCB_FPL_CACHE(), IsModified(), and Load().
|
private |
A hash of the timestamps for all the footprint files.
Definition at line 202 of file gpcb_plugin.cpp.
Referenced by GPCB_FPL_CACHE(), IsModified(), and Load().
|
private |
Map of footprint file name to FOOTPRINT*.
Definition at line 198 of file gpcb_plugin.cpp.
Referenced by GetFootprints(), Load(), and Remove().
|
private |
The path of the library.
Definition at line 197 of file gpcb_plugin.cpp.
Referenced by GetPath(), GPCB_FPL_CACHE(), IsModified(), IsWritable(), Load(), and Remove().
|
private |
Plugin object that owns the cache.
Definition at line 196 of file gpcb_plugin.cpp.
Referenced by GPCB_FPL_CACHE().