KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GPCB_FPL_CACHE Class Reference

Public Member Functions

 GPCB_FPL_CACHE (GPCB_PLUGIN *aOwner, const wxString &aLibraryPath)
 
wxString GetPath () const
 
bool IsWritable () const
 
FOOTPRINT_MAPGetFootprints ()
 
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

FOOTPRINTparseFOOTPRINT (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_PLUGINm_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...
 

Detailed Description

Definition at line 132 of file gpcb_plugin.cpp.

Constructor & Destructor Documentation

◆ GPCB_FPL_CACHE()

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.

Member Function Documentation

◆ GetFootprints()

FOOTPRINT_MAP & GPCB_FPL_CACHE::GetFootprints ( )
inline

Definition at line 139 of file gpcb_plugin.cpp.

References m_footprints.

Referenced by GPCB_PLUGIN::FootprintEnumerate(), and GPCB_PLUGIN::getFootprint().

◆ GetPath()

wxString GPCB_FPL_CACHE::GetPath ( ) const
inline

Definition at line 137 of file gpcb_plugin.cpp.

References m_lib_path.

Referenced by GPCB_PLUGIN::FootprintLibDelete().

◆ GetTimestamp()

long long GPCB_FPL_CACHE::GetTimestamp ( const wxString &  aLibPath)
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().

◆ 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().

◆ IsWritable()

bool GPCB_FPL_CACHE::IsWritable ( ) const
inline

Definition at line 138 of file gpcb_plugin.cpp.

References m_lib_path.

Referenced by GPCB_PLUGIN::FootprintDelete(), and GPCB_PLUGIN::IsFootprintLibWritable().

◆ Load()

◆ parseFOOTPRINT()

◆ parseParameters()

void GPCB_FPL_CACHE::parseParameters ( wxArrayString &  aParameterList,
LINE_READER aLineReader 
)
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 ]

Parameters
aParameterListThis list of parameters parsed.
aLineReaderThe 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().

◆ Remove()

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().

◆ testFlags()

bool GPCB_FPL_CACHE::testFlags ( const wxString &  aFlag,
long  aMask,
const wxChar *  aName 
)
private

Test aFlag for aMask or aName.

Parameters
aFlagis 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.
aMaskis the flag list to test.
aNameis the flag name to find in list.
Returns
true if found.

Definition at line 775 of file gpcb_plugin.cpp.

Referenced by parseFOOTPRINT().

Member Data Documentation

◆ m_cache_dirty

bool GPCB_FPL_CACHE::m_cache_dirty
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().

◆ m_cache_timestamp

long long GPCB_FPL_CACHE::m_cache_timestamp
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().

◆ m_footprints

FOOTPRINT_MAP GPCB_FPL_CACHE::m_footprints
private

Map of footprint file name to FOOTPRINT*.

Definition at line 198 of file gpcb_plugin.cpp.

Referenced by GetFootprints(), Load(), and Remove().

◆ m_lib_path

wxFileName GPCB_FPL_CACHE::m_lib_path
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().

◆ m_owner

GPCB_PLUGIN* GPCB_FPL_CACHE::m_owner
private

Plugin object that owns the cache.

Definition at line 196 of file gpcb_plugin.cpp.

Referenced by GPCB_FPL_CACHE().


The documentation for this class was generated from the following file: