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

Public Member Functions

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

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

Detailed Description

Definition at line 134 of file pcb_io_geda.cpp.

Constructor & Destructor Documentation

◆ GPCB_FPL_CACHE()

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.

Member Function Documentation

◆ GetFootprints()

FOOTPRINT_MAP & GPCB_FPL_CACHE::GetFootprints ( )
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().

◆ GetPath()

wxString GPCB_FPL_CACHE::GetPath ( ) const
inline

Definition at line 139 of file pcb_io_geda.cpp.

References m_lib_path.

Referenced by PCB_IO_GEDA::DeleteLibrary().

◆ 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 304 of file pcb_io_geda.cpp.

References FILEEXT::GedaPcbFootprintLibFileExtension, and TimestampDir().

Referenced by PCB_IO_GEDA::GetLibraryTimestamp(), and IsModified().

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

◆ IsWritable()

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

◆ 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 673 of file pcb_io_geda.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 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().

◆ 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 779 of file pcb_io_geda.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 202 of file pcb_io_geda.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 204 of file pcb_io_geda.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 200 of file pcb_io_geda.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 199 of file pcb_io_geda.cpp.

Referenced by GetPath(), GPCB_FPL_CACHE(), IsModified(), IsWritable(), Load(), and Remove().

◆ m_owner

PCB_IO_GEDA* GPCB_FPL_CACHE::m_owner
private

Plugin object that owns the cache.

Definition at line 198 of file pcb_io_geda.cpp.

Referenced by GPCB_FPL_CACHE().


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