KiCad PCB EDA Suite
GPCB_FPL_CACHE_ITEM Class Reference

Class GPCB_FPL_CACHE_ITEM is helper class for creating a footprint library cache. More...

Public Member Functions

 GPCB_FPL_CACHE_ITEM (MODULE *aModule, const wxFileName &aFileName)
 
wxString GetName () const
 
wxFileName GetFileName () const
 
bool IsModified () const
 
MODULEGetModule () const
 
void UpdateModificationTime ()
 

Private Attributes

wxFileName m_file_name
 The the full file name and path of the footprint to cache. More...
 
bool m_writable
 Writability status of the footprint file. More...
 
wxDateTime m_mod_time
 The last file modified time stamp. More...
 
std::unique_ptr< MODULEm_module
 

Detailed Description

Class GPCB_FPL_CACHE_ITEM is helper class for creating a footprint library cache.

The new footprint library design is a file path of individual module files that contain a single module per file. This class is a helper only for the footprint portion of the PLUGIN API, and only for the PCB_IO plugin. It is private to this implementation file so it is not placed into a header.

Definition at line 139 of file gpcb_plugin.cpp.

Constructor & Destructor Documentation

GPCB_FPL_CACHE_ITEM::GPCB_FPL_CACHE_ITEM ( MODULE aModule,
const wxFileName &  aFileName 
)

Definition at line 157 of file gpcb_plugin.cpp.

References m_file_name, m_mod_time, and m_writable.

157  :
158  m_module( aModule )
159 {
160  m_file_name = aFileName;
161  m_writable = true; // temporary init
162 
163  if( m_file_name.FileExists() )
164  m_mod_time = m_file_name.GetModificationTime();
165  else
166  m_mod_time.Now();
167 }
wxDateTime m_mod_time
The last file modified time stamp.
bool m_writable
Writability status of the footprint file.
wxFileName m_file_name
The the full file name and path of the footprint to cache.
std::unique_ptr< MODULE > m_module

Member Function Documentation

wxFileName GPCB_FPL_CACHE_ITEM::GetFileName ( ) const
inline

Definition at line 150 of file gpcb_plugin.cpp.

References m_file_name.

150 { return m_file_name; }
wxFileName m_file_name
The the full file name and path of the footprint to cache.
MODULE* GPCB_FPL_CACHE_ITEM::GetModule ( ) const
inline

Definition at line 152 of file gpcb_plugin.cpp.

152 { return m_module.get(); }
std::unique_ptr< MODULE > m_module
wxString GPCB_FPL_CACHE_ITEM::GetName ( ) const
inline

Definition at line 149 of file gpcb_plugin.cpp.

149 { return m_file_name.GetDirs().Last(); }
wxFileName m_file_name
The the full file name and path of the footprint to cache.
bool GPCB_FPL_CACHE_ITEM::IsModified ( ) const

Definition at line 170 of file gpcb_plugin.cpp.

References m_file_name, and m_mod_time.

171 {
172  if( !m_file_name.FileExists() )
173  return false;
174 
175  return m_file_name.GetModificationTime() != m_mod_time;
176 }
wxDateTime m_mod_time
The last file modified time stamp.
wxFileName m_file_name
The the full file name and path of the footprint to cache.
void GPCB_FPL_CACHE_ITEM::UpdateModificationTime ( )
inline

Definition at line 153 of file gpcb_plugin.cpp.

153 { m_mod_time = m_file_name.GetModificationTime(); }
wxDateTime m_mod_time
The last file modified time stamp.
wxFileName m_file_name
The the full file name and path of the footprint to cache.

Member Data Documentation

wxFileName GPCB_FPL_CACHE_ITEM::m_file_name
private

The the full file name and path of the footprint to cache.

Definition at line 141 of file gpcb_plugin.cpp.

Referenced by GetFileName(), GPCB_FPL_CACHE_ITEM(), and IsModified().

wxDateTime GPCB_FPL_CACHE_ITEM::m_mod_time
private

The last file modified time stamp.

Definition at line 143 of file gpcb_plugin.cpp.

Referenced by GPCB_FPL_CACHE_ITEM(), and IsModified().

std::unique_ptr<MODULE> GPCB_FPL_CACHE_ITEM::m_module
private

Definition at line 144 of file gpcb_plugin.cpp.

bool GPCB_FPL_CACHE_ITEM::m_writable
private

Writability status of the footprint file.

Definition at line 142 of file gpcb_plugin.cpp.

Referenced by GPCB_FPL_CACHE_ITEM().


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