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 138 of file gpcb_plugin.cpp.

Constructor & Destructor Documentation

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

Definition at line 156 of file gpcb_plugin.cpp.

References m_file_name, m_mod_time, and m_writable.

156  :
157  m_module( aModule )
158 {
159  m_file_name = aFileName;
160  m_writable = true; // temporary init
161 
162  if( m_file_name.FileExists() )
163  m_mod_time = m_file_name.GetModificationTime();
164  else
165  m_mod_time.Now();
166 }
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 149 of file gpcb_plugin.cpp.

References m_file_name.

149 { 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 151 of file gpcb_plugin.cpp.

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

Definition at line 148 of file gpcb_plugin.cpp.

148 { 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 169 of file gpcb_plugin.cpp.

References m_file_name, and m_mod_time.

170 {
171  if( !m_file_name.FileExists() )
172  return false;
173 
174  return m_file_name.GetModificationTime() != m_mod_time;
175 }
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 152 of file gpcb_plugin.cpp.

152 { 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 140 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 142 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 143 of file gpcb_plugin.cpp.

bool GPCB_FPL_CACHE_ITEM::m_writable
private

Writability status of the footprint file.

Definition at line 141 of file gpcb_plugin.cpp.

Referenced by GPCB_FPL_CACHE_ITEM().


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