KiCad PCB EDA Suite
FP_LIB_TABLE_GRID Class Reference

This class builds a wxGridTableBase by wrapping an FP_LIB_TABLE object. More...

Inheritance diagram for FP_LIB_TABLE_GRID:
LIB_TABLE_GRID FP_LIB_TABLE LIB_TABLE PROJECT::_ELEM

Public Types

enum  SAVE_T { SAVE_OK, SAVE_SKIPPED }
 Enum SAVE_T is the set of return values from FootprintSave() below. More...
 

Public Member Functions

 FP_LIB_TABLE_GRID (const FP_LIB_TABLE &aTableToEdit)
 
int GetNumberRows () override
 
int GetNumberCols () override
 
wxString GetValue (int aRow, int aCol) override
 
void SetValue (int aRow, int aCol, const wxString &aValue) override
 
bool IsEmptyCell (int aRow, int aCol) override
 
bool InsertRows (size_t aPos=0, size_t aNumRows=1) override
 
bool AppendRows (size_t aNumRows=1) override
 
bool DeleteRows (size_t aPos, size_t aNumRows) override
 
wxString GetColLabelValue (int aCol) override
 
virtual void Parse (LIB_TABLE_LEXER *aLexer) override
 Function Parse. More...
 
virtual void Format (OUTPUTFORMATTER *aOutput, int aIndentLevel) const override
 Generate the table in s-expression format to aOutput with an indention level of aIndentLevel. More...
 
bool operator== (const FP_LIB_TABLE &aFpTable) const
 
bool operator== (const LIB_TABLE &r) const
 
bool operator!= (const FP_LIB_TABLE &r) const
 
bool operator!= (const LIB_TABLE &r) const
 
const FP_LIB_TABLE_ROWFindRow (const wxString &aNickName)
 Function FindRow. More...
 
void FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aNickname)
 Return a list of footprint names contained within the library given by aNickname. More...
 
void PrefetchLib (const wxString &aNickname)
 Function PrefetchLib If possible, prefetches the specified library (e.g. More...
 
MODULEFootprintLoad (const wxString &aNickname, const wxString &aFootprintName)
 Function FootprintLoad. More...
 
SAVE_T FootprintSave (const wxString &aNickname, const MODULE *aFootprint, bool aOverwrite=true)
 Function FootprintSave. More...
 
void FootprintDelete (const wxString &aNickname, const wxString &aFootprintName)
 Function FootprintDelete. More...
 
bool IsFootprintLibWritable (const wxString &aNickname)
 Function IsFootprintLibWritable. More...
 
void FootprintLibDelete (const wxString &aNickname)
 
void FootprintLibCreate (const wxString &aNickname)
 
MODULEFootprintLoadWithOptionalNickname (const LIB_ID &aFootprintId)
 Function FootprintLoadWithOptionalNickname loads a footprint having aFootprintId with possibly an empty nickname. More...
 
void Clear ()
 Delete all rows. More...
 
int GetCount ()
 
LIB_TABLE_ROWAt (int aIndex)
 
bool IsEmpty (bool aIncludeFallback=true)
 Function IsEmpty. More...
 
const wxString GetDescription (const wxString &aNickname)
 Function GetDescription. More...
 
std::vector< wxString > GetLogicalLibs ()
 Function GetLogicalLibs. More...
 
bool InsertRow (LIB_TABLE_ROW *aRow, bool doReplace=false)
 Function InsertRow. More...
 
const LIB_TABLE_ROWFindRowByURI (const wxString &aURI)
 Function FindRowByURI. More...
 
void Load (const wxString &aFileName)
 Function Load. More...
 
void Save (const wxString &aFileName) const
 Function Save. More...
 
size_t GetEnvVars (wxArrayString &aEnvVars) const
 Search the paths all of the LIB_TABLE_ROWS of the LIB_TABLE and add all of the environment variable substitutions to aEnvVars. More...
 

Static Public Member Functions

static bool LoadGlobalTable (FP_LIB_TABLE &aTable)
 Function LoadGlobalTable loads the global footprint library table into aTable. More...
 
static wxString GetGlobalTableFileName ()
 Function GetGlobalTableFileName. More...
 
static const wxString GlobalPathEnvVariableName ()
 Function GlobalPathEnvVarVariableName. More...
 
static PROPERTIESParseOptions (const std::string &aOptionsList)
 Function ParseOptions. More...
 
static UTF8 FormatOptions (const PROPERTIES *aProperties)
 Function FormatOptions. More...
 
static const wxString ExpandSubstitutions (const wxString &aString)
 Function ExpandSubstitutions. More...
 

Protected Types

typedef std::map< wxString, int > INDEX
 this is a non-owning index into the LIB_TABLE_ROWS table More...
 
typedef INDEX::iterator INDEX_ITER
 
typedef INDEX::const_iterator INDEX_CITER
 
typedef INDEX::value_type INDEX_VALUE
 

Protected Member Functions

LIB_TABLE_ROWat (size_t aIndex) override
 
size_t size () const override
 
LIB_TABLE_ROWmakeNewRow () override
 
LIB_TABLE_ROWS_ITER begin () override
 
LIB_TABLE_ROWS_ITER insert (LIB_TABLE_ROWS_ITER aIterator, LIB_TABLE_ROW *aRow) override
 
void push_back (LIB_TABLE_ROW *aRow) override
 
LIB_TABLE_ROWS_ITER erase (LIB_TABLE_ROWS_ITER aFirst, LIB_TABLE_ROWS_ITER aLast) override
 
LIB_TABLE_ROWfindRow (const wxString &aNickname) const
 Function findRow returns a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment, else NULL. More...
 
void reindex ()
 
void ensureIndex ()
 

Protected Attributes

LIB_TABLE_ROWS rows
 
INDEX nickIndex
 this particular key is the nickName within each row. More...
 
LIB_TABLEfallBack
 

Friends

class FP_GRID_TRICKS
 

Detailed Description

This class builds a wxGridTableBase by wrapping an FP_LIB_TABLE object.

Definition at line 53 of file dialog_fp_lib_table.cpp.

Member Typedef Documentation

typedef std::map<wxString,int> LIB_TABLE::INDEX
protectedinherited

this is a non-owning index into the LIB_TABLE_ROWS table

Definition at line 506 of file lib_table_base.h.

typedef INDEX::const_iterator LIB_TABLE::INDEX_CITER
protectedinherited

Definition at line 508 of file lib_table_base.h.

typedef INDEX::iterator LIB_TABLE::INDEX_ITER
protectedinherited

Definition at line 507 of file lib_table_base.h.

typedef INDEX::value_type LIB_TABLE::INDEX_VALUE
protectedinherited

Definition at line 509 of file lib_table_base.h.

Member Enumeration Documentation

enum FP_LIB_TABLE::SAVE_T
inherited

Enum SAVE_T is the set of return values from FootprintSave() below.

Enumerator
SAVE_OK 
SAVE_SKIPPED 

Definition at line 187 of file fp_lib_table.h.

Constructor & Destructor Documentation

FP_LIB_TABLE_GRID::FP_LIB_TABLE_GRID ( const FP_LIB_TABLE aTableToEdit)
inline

Definition at line 83 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

84  {
85  rows = aTableToEdit.rows;
86  }
LIB_TABLE_ROWS rows

Member Function Documentation

bool LIB_TABLE_GRID::AppendRows ( size_t  aNumRows = 1)
inlineoverrideinherited

Definition at line 121 of file lib_table_grid.h.

References LIB_TABLE_GRID::makeNewRow(), and LIB_TABLE_GRID::push_back().

Referenced by FP_GRID_TRICKS::paste_text().

122  {
123  // do not modify aNumRows, original value needed for wxGridTableMessage below
124  for( int i = aNumRows; i; --i )
125  push_back( makeNewRow() );
126 
127  if( GetView() )
128  {
129  wxGridTableMessage msg( this,
130  wxGRIDTABLE_NOTIFY_ROWS_APPENDED,
131  aNumRows );
132 
133  GetView()->ProcessTableMessage( msg );
134  }
135 
136  return true;
137  }
virtual LIB_TABLE_ROW * makeNewRow()=0
virtual void push_back(LIB_TABLE_ROW *aRow)=0
LIB_TABLE_ROW* FP_LIB_TABLE_GRID::at ( size_t  aIndex)
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 58 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

58 { return &rows.at( aIndex ); }
LIB_TABLE_ROWS rows
LIB_TABLE_ROW* LIB_TABLE::At ( int  aIndex)
inlineinherited

Definition at line 354 of file lib_table_base.h.

References LIB_TABLE::rows.

Referenced by FP_GRID_TRICKS::paste_text().

354 { return &rows[aIndex]; }
LIB_TABLE_ROWS rows
LIB_TABLE_ROWS_ITER FP_LIB_TABLE_GRID::begin ( )
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 67 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

67 { return rows.begin(); }
LIB_TABLE_ROWS rows
void LIB_TABLE::Clear ( )
inlineinherited

Delete all rows.

Definition at line 328 of file lib_table_base.h.

References LIB_TABLE::nickIndex, and LIB_TABLE::rows.

Referenced by DIALOG_FP_LIB_TABLE::onOKButtonClick().

329  {
330  rows.clear();
331  nickIndex.clear();
332  }
LIB_TABLE_ROWS rows
INDEX nickIndex
this particular key is the nickName within each row.
bool LIB_TABLE_GRID::DeleteRows ( size_t  aPos,
size_t  aNumRows 
)
inlineoverrideinherited

Definition at line 139 of file lib_table_grid.h.

References LIB_TABLE_GRID::begin(), LIB_TABLE_GRID::erase(), and LIB_TABLE_GRID::size().

Referenced by DIALOG_FP_LIB_TABLE::verifyTables().

140  {
141  // aPos may be a large positive, e.g. size_t(-1), and the sum of
142  // aPos+aNumRows may wrap here, so both ends of the range are tested.
143  if( aPos < size() && aPos + aNumRows <= size() )
144  {
145  LIB_TABLE_ROWS_ITER start = begin() + aPos;
146  erase( start, start + aNumRows );
147 
148  if( GetView() )
149  {
150  wxGridTableMessage msg( this,
151  wxGRIDTABLE_NOTIFY_ROWS_DELETED,
152  aPos,
153  aNumRows );
154 
155  GetView()->ProcessTableMessage( msg );
156  }
157 
158  return true;
159  }
160 
161  return false;
162  }
virtual LIB_TABLE_ROWS_ITER begin()=0
virtual size_t size() const =0
LIB_TABLE_ROWS::iterator LIB_TABLE_ROWS_ITER
virtual LIB_TABLE_ROWS_ITER erase(LIB_TABLE_ROWS_ITER aFirst, LIB_TABLE_ROWS_ITER aLast)=0
void LIB_TABLE::ensureIndex ( )
inlineprotectedinherited

Definition at line 494 of file lib_table_base.h.

References LIB_TABLE::nickIndex, and LIB_TABLE::reindex().

Referenced by LIB_TABLE::findRow(), LIB_TABLE::FindRowByURI(), and LIB_TABLE::InsertRow().

495  {
496  // The dialog lib table editor may not maintain the nickIndex.
497  // Lazy indexing may be required. To handle lazy indexing, we must enforce
498  // that "nickIndex" is either empty or accurate, but never inaccurate.
499  if( !nickIndex.size() )
500  reindex();
501  }
void reindex()
INDEX nickIndex
this particular key is the nickName within each row.
LIB_TABLE_ROWS_ITER FP_LIB_TABLE_GRID::erase ( LIB_TABLE_ROWS_ITER  aFirst,
LIB_TABLE_ROWS_ITER  aLast 
)
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 76 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

77  {
78  return rows.erase( aFirst, aLast );
79  }
LIB_TABLE_ROWS rows
const wxString LIB_TABLE::ExpandSubstitutions ( const wxString &  aString)
staticinherited

Function ExpandSubstitutions.

replaces any environment variable references with their values and is here to fully embellish the TABLE_ROW::uri in a platform independent way. This enables library tables to have platform dependent environment variables in them, allowing for a uniform table across platforms.

Definition at line 512 of file lib_table_base.cpp.

References ExpandEnvVarSubstitutions().

Referenced by GITHUB_PLUGIN::cacheLib(), LIB_TABLE_ROW::GetFullURI(), and LIB_TABLE_ROW::SetFullURI().

513 {
514  return ExpandEnvVarSubstitutions( aString );
515 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString)
Function ExpandEnvVarSubstitutions replaces any environment variable references with their values...
Definition: common.cpp:254
const FP_LIB_TABLE_ROW * FP_LIB_TABLE::FindRow ( const wxString &  aNickName)
inherited

Function FindRow.

returns an FP_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table fragment. The PLUGIN is loaded and attached to the "plugin" field of the FP_LIB_TABLE_ROW if not already loaded.

Exceptions
IO_ERRORif aNickName cannot be found.

Definition at line 247 of file fp_lib_table.cpp.

References LIB_TABLE::findRow(), Format(), GetChars(), FP_LIB_TABLE_ROW::plugin, IO_MGR::PluginFind(), FP_LIB_TABLE_ROW::setPlugin(), THROW_IO_ERROR, and FP_LIB_TABLE_ROW::type.

Referenced by FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), FP_LIB_TABLE::FootprintDelete(), FP_LIB_TABLE::FootprintEnumerate(), FP_LIB_TABLE::FootprintLibCreate(), FP_LIB_TABLE::FootprintLibDelete(), FP_LIB_TABLE::FootprintLoad(), FP_LIB_TABLE::FootprintSave(), FOOTPRINT_EDIT_FRAME::getLibPath(), FP_LIB_TABLE::IsFootprintLibWritable(), FP_LIB_TABLE::PrefetchLib(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), and FOOTPRINT_EDIT_FRAME::updateTitle().

248 {
249  FP_LIB_TABLE_ROW* row = dynamic_cast< FP_LIB_TABLE_ROW* >( findRow( aNickname ) );
250 
251  if( !row )
252  {
253  wxString msg = wxString::Format(
254  _( "fp-lib-table files contain no library with nickname '%s'" ),
255  GetChars( aNickname ) );
256 
257  THROW_IO_ERROR( msg );
258  }
259 
260  // We've been 'lazy' up until now, but it cannot be deferred any longer,
261  // instantiate a PLUGIN of the proper kind if it is not already in this
262  // FP_LIB_TABLE_ROW.
263  if( !row->plugin )
264  row->setPlugin( IO_MGR::PluginFind( row->type ) );
265 
266  return row;
267 }
void setPlugin(PLUGIN *aPlugin)
Definition: fp_lib_table.h:93
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Function findRow returns a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBa...
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
static PLUGIN * PluginFind(PCB_FILE_T aFileType)
Function PluginFind returns a PLUGIN which the caller can use to import, export, save, or load design documents.
Definition: io_mgr.cpp:58
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
LIB_TABLE_ROW * LIB_TABLE::findRow ( const wxString &  aNickname) const
protectedinherited

Function findRow returns a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment, else NULL.

Definition at line 254 of file lib_table_base.cpp.

References LIB_TABLE::ensureIndex(), LIB_TABLE::fallBack, LIB_TABLE::nickIndex, and LIB_TABLE::rows.

Referenced by SYMBOL_LIB_TABLE::FindRow(), FP_LIB_TABLE::FindRow(), and LIB_TABLE::GetDescription().

255 {
256  LIB_TABLE* cur = (LIB_TABLE*) this;
257 
258  do
259  {
260  cur->ensureIndex();
261 
262  INDEX_CITER it = cur->nickIndex.find( aNickName );
263 
264  if( it != cur->nickIndex.end() )
265  {
266  return &cur->rows[it->second]; // found
267  }
268 
269  // not found, search fall back table(s), if any
270  } while( ( cur = cur->fallBack ) != 0 );
271 
272  return NULL; // not found
273 }
void ensureIndex()
INDEX::const_iterator INDEX_CITER
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
INDEX nickIndex
this particular key is the nickName within each row.
Class LIB_TABLE.
const LIB_TABLE_ROW * LIB_TABLE::FindRowByURI ( const wxString &  aURI)
inherited

Function FindRowByURI.

Returns
a LIB_TABLE_ROW pointer if aURI is found in this table or in any chained fallBack table fragments, else NULL.

Definition at line 276 of file lib_table_base.cpp.

References LIB_TABLE::ensureIndex(), LIB_TABLE::fallBack, and LIB_TABLE::rows.

277 {
278  LIB_TABLE* cur = this;
279 
280  do
281  {
282  cur->ensureIndex();
283 
284  for( unsigned i = 0; i < cur->rows.size(); i++ )
285  {
286  wxString uri = cur->rows[i].GetFullURI( true );
287 
288  if( wxFileName::GetPathSeparator() == wxChar( '\\' ) && uri.Find( wxChar( '/' ) ) >= 0 )
289  uri.Replace( "/", "\\" );
290 
291  if( (wxFileName::IsCaseSensitive() && uri == aURI)
292  || (!wxFileName::IsCaseSensitive() && uri.Upper() == aURI.Upper() ) )
293  {
294  return &cur->rows[i]; // found
295  }
296  }
297 
298  // not found, search fall back table(s), if any
299  } while( ( cur = cur->fallBack ) != 0 );
300 
301  return NULL; // not found
302 }
void ensureIndex()
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
Class LIB_TABLE.
void FP_LIB_TABLE::FootprintDelete ( const wxString &  aNickname,
const wxString &  aFootprintName 
)
inherited

Function FootprintDelete.

deletes the aFootprintName from the library given by aNickname.

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW.
aFootprintNameis the name of a footprint to delete from the specified library.
Exceptions
IO_ERRORif there is a problem finding the footprint or the library, or deleting it.

Definition at line 327 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), PLUGIN::FootprintDelete(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and FP_LIB_TABLE_ROW::plugin.

Referenced by FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary().

328 {
329  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
330  wxASSERT( (PLUGIN*) row->plugin );
331  return row->plugin->FootprintDelete( row->GetFullURI( true ), aFootprintName,
332  row->GetProperties() );
333 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
virtual void FootprintDelete(const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=NULL)
Function FootprintDelete deletes aFootprintName from the library at aLibraryPath. ...
Definition: plugin.cpp:92
void FP_LIB_TABLE::FootprintEnumerate ( wxArrayString &  aFootprintNames,
const wxString &  aNickname 
)
inherited

Return a list of footprint names contained within the library given by aNickname.

Parameters
aFootprintNamesis the list to fill with the footprint names found in aNickname
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW.
Exceptions
IO_ERRORif the library cannot be found, or footprint cannot be loaded.

Definition at line 230 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), PLUGIN::FootprintEnumerate(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and FP_LIB_TABLE_ROW::plugin.

Referenced by guessNickname(), and FOOTPRINT_LIST_IMPL::JoinWorkers().

231 {
232  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
233  wxASSERT( (PLUGIN*) row->plugin );
234  row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ),
235  row->GetProperties() );
236 }
virtual void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Return a list of footprint names contained within the library at aLibraryPath.
Definition: plugin.cpp:61
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
void FP_LIB_TABLE::FootprintLibCreate ( const wxString &  aNickname)
inherited

Definition at line 352 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), PLUGIN::FootprintLibCreate(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and FP_LIB_TABLE_ROW::plugin.

353 {
354  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
355  wxASSERT( (PLUGIN*) row->plugin );
356  row->plugin->FootprintLibCreate( row->GetFullURI( true ), row->GetProperties() );
357 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
virtual void FootprintLibCreate(const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Function FootprintLibCreate creates a new empty footprint library at aLibraryPath empty...
Definition: plugin.cpp:99
void FP_LIB_TABLE::FootprintLibDelete ( const wxString &  aNickname)
inherited

Definition at line 344 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), PLUGIN::FootprintLibDelete(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and FP_LIB_TABLE_ROW::plugin.

345 {
346  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
347  wxASSERT( (PLUGIN*) row->plugin );
348  row->plugin->FootprintLibDelete( row->GetFullURI( true ), row->GetProperties() );
349 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
virtual bool FootprintLibDelete(const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Function FootprintLibDelete deletes an existing footprint library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason.
Definition: plugin.cpp:106
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
MODULE * FP_LIB_TABLE::FootprintLoad ( const wxString &  aNickname,
const wxString &  aFootprintName 
)
inherited

Function FootprintLoad.

loads a footprint having aFootprintName from the library given by aNickname.

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW
aFootprintNameis the name of the footprint to load.
Returns
MODULE* - if found caller owns it, else NULL if not found.
Exceptions
IO_ERRORif the library cannot be found or read. No exception is thrown in the case where aFootprintName cannot be found.

Definition at line 270 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), PLUGIN::FootprintLoad(), MODULE::GetFPID(), LIB_TABLE_ROW::GetFullURI(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE_ROW::GetProperties(), FP_LIB_TABLE_ROW::plugin, LIB_ID::SetLibNickname(), UTF8::size(), and UTF8::wx_str().

Referenced by FP_LIB_TABLE::FootprintLoadWithOptionalNickname(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_INFO_IMPL::load(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), and FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint().

271 {
272  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
273  wxASSERT( (PLUGIN*) row->plugin );
274 
275  MODULE* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
276  row->GetProperties() );
277 
278  // The library cannot know its own name, because it might have been renamed or moved.
279  // Therefore footprints cannot know their own library nickname when residing in
280  // a footprint library.
281  // Only at this API layer can we tell the footprint about its actual library nickname.
282  if( ret )
283  {
284  // remove "const"-ness, I really do want to set nickname without
285  // having to copy the LIB_ID and its two strings, twice each.
286  LIB_ID& fpid = (LIB_ID&) ret->GetFPID();
287 
288  // Catch any misbehaving plugin, which should be setting internal footprint name properly:
289  wxASSERT( aFootprintName == fpid.GetLibItemName().wx_str() );
290 
291  // and clearing nickname
292  wxASSERT( !fpid.GetLibNickname().size() );
293 
294  fpid.SetLibNickname( row->GetNickName() );
295  }
296 
297  return ret;
298 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
std::string::size_type size() const
Definition: utf8.h:115
Class LIB_ID.
Definition: lib_id.h:56
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
const LIB_ID & GetFPID() const
Definition: class_module.h:164
wxString wx_str() const
Definition: utf8.cpp:48
virtual MODULE * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=NULL)
Function FootprintLoad loads a footprint having aFootprintName from the aLibraryPath containing a lib...
Definition: plugin.cpp:76
const UTF8 & GetLibItemName() const
Function GetLibItemName.
Definition: lib_id.h:129
int SetLibNickname(const UTF8 &aNickname)
Function SetLibNickname.
Definition: lib_id.cpp:219
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
const wxString & GetNickName() const
Function GetNickName.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
const UTF8 & GetLibNickname() const
Function GetLibNickname.
Definition: lib_id.h:108
MODULE * FP_LIB_TABLE::FootprintLoadWithOptionalNickname ( const LIB_ID aFootprintId)
inherited

Function FootprintLoadWithOptionalNickname loads a footprint having aFootprintId with possibly an empty nickname.

Parameters
aFootprintIdthe [nickname] & footprint name of the footprint to load.
Returns
MODULE* - if found caller owns it, else NULL if not found.
Exceptions
IO_ERRORif the library cannot be found or read. No exception is thrown in the case where aFootprintName cannot be found.
PARSE_ERRORif aFootprintId is not parsed OK.

Definition at line 360 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FootprintLoad(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LIB_TABLE::GetLogicalLibs().

Referenced by PCB_BASE_FRAME::loadFootprint(), and FP_LOADER_THREAD::ProcessEntry().

361 {
362  wxString nickname = aFootprintId.GetLibNickname();
363  wxString fpname = aFootprintId.GetLibItemName();
364 
365  if( nickname.size() )
366  {
367  return FootprintLoad( nickname, fpname );
368  }
369 
370  // nickname is empty, sequentially search (alphabetically) all libs/nicks for first match:
371  else
372  {
373  std::vector<wxString> nicks = GetLogicalLibs();
374 
375  // Search each library going through libraries alphabetically.
376  for( unsigned i = 0; i < nicks.size(); ++i )
377  {
378  // FootprintLoad() returns NULL on not found, does not throw exception
379  // unless there's an IO_ERROR.
380  MODULE* ret = FootprintLoad( nicks[i], fpname );
381 
382  if( ret )
383  return ret;
384  }
385 
386  return NULL;
387  }
388 }
MODULE * FootprintLoad(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintLoad.
const UTF8 & GetLibItemName() const
Function GetLibItemName.
Definition: lib_id.h:129
const UTF8 & GetLibNickname() const
Function GetLibNickname.
Definition: lib_id.h:108
std::vector< wxString > GetLogicalLibs()
Function GetLogicalLibs.
FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave ( const wxString &  aNickname,
const MODULE aFootprint,
bool  aOverwrite = true 
)
inherited

Function FootprintSave.

will write aFootprint to an existing library given by aNickname. If a footprint by the same name already exists, it is replaced.

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW
aFootprintis what to store in the library. The caller continues to own the footprint after this call.
aOverwritewhen true means overwrite any existing footprint by the same name, else if false means skip the write and return SAVE_SKIPPED.
Returns
SAVE_T - SAVE_OK or SAVE_SKIPPED. If error saving, then IO_ERROR is thrown.
Exceptions
IO_ERRORif there is a problem saving.

Definition at line 301 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), PLUGIN::FootprintLoad(), PLUGIN::FootprintSave(), MODULE::GetFPID(), LIB_TABLE_ROW::GetFullURI(), LIB_ID::GetLibItemName(), LIB_TABLE_ROW::GetProperties(), FP_LIB_TABLE_ROW::plugin, FP_LIB_TABLE::SAVE_OK, and FP_LIB_TABLE::SAVE_SKIPPED.

Referenced by PCB_EDIT_FRAME::ArchiveModulesOnBoard(), and FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary().

303 {
304  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
305  wxASSERT( (PLUGIN*) row->plugin );
306 
307  if( !aOverwrite )
308  {
309  // Try loading the footprint to see if it already exists, caller wants overwrite
310  // protection, which is atypical, not the default.
311 
312  wxString fpname = aFootprint->GetFPID().GetLibItemName();
313 
314  std::unique_ptr<MODULE> footprint( row->plugin->FootprintLoad( row->GetFullURI( true ),
315  fpname, row->GetProperties() ) );
316 
317  if( footprint.get() )
318  return SAVE_SKIPPED;
319  }
320 
321  row->plugin->FootprintSave( row->GetFullURI( true ), aFootprint, row->GetProperties() );
322 
323  return SAVE_OK;
324 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
virtual void FootprintSave(const wxString &aLibraryPath, const MODULE *aFootprint, const PROPERTIES *aProperties=NULL)
Function FootprintSave will write aModule to an existing library located at aLibraryPath.
Definition: plugin.cpp:85
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
const LIB_ID & GetFPID() const
Definition: class_module.h:164
virtual MODULE * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=NULL)
Function FootprintLoad loads a footprint having aFootprintName from the aLibraryPath containing a lib...
Definition: plugin.cpp:76
const UTF8 & GetLibItemName() const
Function GetLibItemName.
Definition: lib_id.h:129
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
void FP_LIB_TABLE::Format ( OUTPUTFORMATTER aOutput,
int  aIndentLevel 
) const
overridevirtualinherited

Generate the table in s-expression format to aOutput with an indention level of aIndentLevel.

Parameters
aOutputis the OUTPUTFORMATTER to format the table into.
aIndentLevelis the indentation level (2 spaces) to indent.
Exceptions
IO_ERRORif an I/O error occurs during output.
boost::interprocess::lock_exceptif separate process attempt to access the table.

Implements LIB_TABLE.

Definition at line 219 of file fp_lib_table.cpp.

References OUTPUTFORMATTER::Print(), and LIB_TABLE::rows.

Referenced by FOOTPRINT_ASYNC_LOADER::IsSameTable(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), and FOOTPRINT_ASYNC_LOADER::Start().

220 {
221  aOutput->Print( aIndentLevel, "(fp_lib_table\n" );
222 
223  for( LIB_TABLE_ROWS_CITER it = rows.begin(); it != rows.end(); ++it )
224  it->Format( aOutput, aIndentLevel+1 );
225 
226  aOutput->Print( aIndentLevel, ")\n" );
227 }
LIB_TABLE_ROWS rows
LIB_TABLE_ROWS::const_iterator LIB_TABLE_ROWS_CITER
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:408
UTF8 LIB_TABLE::FormatOptions ( const PROPERTIES aProperties)
staticinherited

Function FormatOptions.

returns a list of options from the aProperties parameter. The name=value pairs will be separated with the '|' character. The =value portion may not be present. You might expect something like "name1=value1|name2=value2|flag_me". Notice that flag_me does not have a value. This is ok.

Parameters
aPropertiesis the PROPERTIES to format or NULL. If NULL the returned string will be empty.

Definition at line 474 of file lib_table_base.cpp.

References UTF8::begin(), UTF8::end(), name, OPT_SEP, and UTF8::size().

Referenced by DIALOG_FP_PLUGIN_OPTIONS::makeResult().

475 {
476  UTF8 ret;
477 
478  if( aProperties )
479  {
480  for( PROPERTIES::const_iterator it = aProperties->begin(); it != aProperties->end(); ++it )
481  {
482  const std::string& name = it->first;
483 
484  const UTF8& value = it->second;
485 
486  if( ret.size() )
487  ret += OPT_SEP;
488 
489  ret += name;
490 
491  // the separation between name and value is '='
492  if( value.size() )
493  {
494  ret += '=';
495 
496  for( std::string::const_iterator si = value.begin(); si != value.end(); ++si )
497  {
498  // escape any separator in the value.
499  if( *si == OPT_SEP )
500  ret += '\\';
501 
502  ret += *si;
503  }
504  }
505  }
506  }
507 
508  return ret;
509 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
std::string::size_type size() const
Definition: utf8.h:115
std::string::const_iterator end() const
Definition: utf8.h:190
std::string::const_iterator begin() const
Definition: utf8.h:189
const char * name
#define OPT_SEP
options separator character
wxString LIB_TABLE_GRID::GetColLabelValue ( int  aCol)
inlineoverrideinherited

Definition at line 164 of file lib_table_grid.h.

References COL_DESCR, COL_NICKNAME, COL_OPTIONS, COL_TYPE, and COL_URI.

165  {
166  switch( aCol )
167  {
168  case COL_NICKNAME: return _( "Nickname" );
169  case COL_URI: return _( "Library Path" );
170 
171  // keep this "Plugin Type" text fairly long so column is sized wide enough
172  case COL_TYPE: return _( "Plugin Type" );
173  case COL_OPTIONS: return _( "Options" );
174  case COL_DESCR: return _( "Description" );
175  default: return wxEmptyString;
176  }
177  }
int LIB_TABLE::GetCount ( )
inlineinherited

Definition at line 352 of file lib_table_base.h.

References LIB_TABLE::rows.

Referenced by FP_GRID_TRICKS::paste_text().

352 { return rows.size(); }
LIB_TABLE_ROWS rows
const wxString LIB_TABLE::GetDescription ( const wxString &  aNickname)
inherited

Function GetDescription.

Returns
the library description from aNickname, or an empty string if aNickname does not exist.

Definition at line 242 of file lib_table_base.cpp.

References LIB_TABLE::findRow(), and LIB_TABLE_ROW::GetDescr().

Referenced by PCB_BASE_FRAME::SelectLibrary().

243 {
244  // use "no exception" form of find row:
245  const LIB_TABLE_ROW* row = findRow( aNickname );
246 
247  if( row )
248  return row->GetDescr();
249  else
250  return wxEmptyString;
251 }
Class LIB_TABLE_ROW.
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Function findRow returns a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBa...
const wxString & GetDescr() const
Function GetDescr.
size_t LIB_TABLE::GetEnvVars ( wxArrayString &  aEnvVars) const
inherited

Search the paths all of the LIB_TABLE_ROWS of the LIB_TABLE and add all of the environment variable substitutions to aEnvVars.

This will only add unique environment variables to the list. Duplicates are ignored.

Parameters
aEnvVarsis the array to load the environment variables.
Returns
the number of unique environment variables found in the table.

Definition at line 380 of file lib_table_base.cpp.

References LIB_TABLE::fallBack, and LIB_TABLE::rows.

381 {
382  const LIB_TABLE* cur = this;
383 
384  do
385  {
386  for( unsigned i = 0; i < cur->rows.size(); i++ )
387  {
388  wxString uri = cur->rows[i].GetFullURI( false );
389 
390  int start = uri.Find( "${" );
391 
392  if( start == wxNOT_FOUND )
393  continue;
394 
395  int end = uri.Find( '}' );
396 
397  if( end == wxNOT_FOUND || end < start+2 )
398  continue;
399 
400  wxString envVar = uri.Mid( start+2, end - (start+2) );
401 
402  if( aEnvVars.Index( envVar, false ) == wxNOT_FOUND )
403  aEnvVars.Add( envVar );
404  }
405 
406  // not found, search fall back table(s), if any
407  } while( ( cur = cur->fallBack ) != 0 );
408 
409  return aEnvVars.GetCount();
410 }
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
Class LIB_TABLE.
wxString FP_LIB_TABLE::GetGlobalTableFileName ( )
staticinherited

Function GetGlobalTableFileName.

Returns
the platform specific global footprint library path and file name.

Definition at line 431 of file fp_lib_table.cpp.

References GetKicadConfigPath(), and global_tbl_name.

Referenced by DIALOG_FP_LIB_TABLE::DIALOG_FP_LIB_TABLE(), FP_LIB_TABLE::LoadGlobalTable(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), PCB_EDIT_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

432 {
433  wxFileName fn;
434 
435  fn.SetPath( GetKicadConfigPath() );
436  fn.SetName( global_tbl_name );
437 
438  return fn.GetFullPath();
439 }
static const wxChar global_tbl_name[]
wxString GetKicadConfigPath()
Function GetKicadConfigPath.
Definition: common.cpp:217
std::vector< wxString > LIB_TABLE::GetLogicalLibs ( )
inherited

Function GetLogicalLibs.

returns the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.

Definition at line 305 of file lib_table_base.cpp.

References LIB_TABLE::fallBack, and LIB_TABLE::rows.

Referenced by CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FP_LIB_TABLE::FootprintLoadWithOptionalNickname(), guessNickname(), CVPCB_MAINFRAME::LoadFootprintFiles(), SYMBOL_LIB_TABLE::LoadSymbolWithOptionalNickname(), FOOTPRINT_VIEWER_FRAME::OnActivate(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), PCB_BASE_FRAME::SelectLibrary(), and FOOTPRINT_LIST_IMPL::StartWorkers().

306 {
307  // Only return unique logical library names. Use std::set::insert() to
308  // quietly reject any duplicates, which can happen when encountering a duplicate
309  // nickname from one of the fall back table(s).
310 
311  std::set< wxString > unique;
312  std::vector< wxString > ret;
313  const LIB_TABLE* cur = this;
314 
315  do
316  {
317  for( LIB_TABLE_ROWS_CITER it = cur->rows.begin(); it!=cur->rows.end(); ++it )
318  {
319  unique.insert( it->GetNickName() );
320  }
321 
322  } while( ( cur = cur->fallBack ) != 0 );
323 
324  ret.reserve( unique.size() );
325 
326  // return a sorted, unique set of nicknames in a std::vector<wxString> to caller
327  for( std::set< wxString >::const_iterator it = unique.begin(); it!=unique.end(); ++it )
328  {
329  ret.push_back( *it );
330  }
331 
332  return ret;
333 }
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
LIB_TABLE_ROWS::const_iterator LIB_TABLE_ROWS_CITER
Class LIB_TABLE.
int LIB_TABLE_GRID::GetNumberCols ( )
inlineoverrideinherited

Definition at line 50 of file lib_table_grid.h.

References COL_COUNT.

50 { return COL_COUNT; }
int LIB_TABLE_GRID::GetNumberRows ( )
inlineoverrideinherited
wxString LIB_TABLE_GRID::GetValue ( int  aRow,
int  aCol 
)
inlineoverrideinherited

Definition at line 52 of file lib_table_grid.h.

References LIB_TABLE_GRID::at(), COL_DESCR, COL_NICKNAME, COL_OPTIONS, COL_TYPE, COL_URI, LIB_TABLE_ROW::GetDescr(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE_ROW::GetOptions(), LIB_TABLE_ROW::GetType(), and LIB_TABLE_GRID::size().

Referenced by LIB_TABLE_GRID::IsEmptyCell(), DIALOG_FP_LIB_TABLE::populateEnvironReadOnlyTable(), and DIALOG_FP_LIB_TABLE::verifyTables().

53  {
54  if( aRow < (int) size() )
55  {
56  const LIB_TABLE_ROW* r = at( (size_t) aRow );
57 
58  switch( aCol )
59  {
60  case COL_NICKNAME: return r->GetNickName();
61  case COL_URI: return r->GetFullURI();
62  case COL_TYPE: return r->GetType();
63  case COL_OPTIONS: return r->GetOptions();
64  case COL_DESCR: return r->GetDescr();
65  default:
66  ; // fall thru to wxEmptyString
67  }
68  }
69 
70  return wxEmptyString;
71  }
Class LIB_TABLE_ROW.
virtual LIB_TABLE_ROW * at(size_t aIndex)=0
const wxString & GetOptions() const
Function GetOptions.
virtual const wxString GetType() const =0
Function GetType.
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
const wxString & GetDescr() const
Function GetDescr.
virtual size_t size() const =0
const wxString & GetNickName() const
Function GetNickName.
const wxString FP_LIB_TABLE::GlobalPathEnvVariableName ( )
staticinherited

Function GlobalPathEnvVarVariableName.

returns the name of the environment variable used to hold the directory of locally installed "KiCad sponsored" system footprint libraries. These can be either legacy or pretty format. The only thing special about this particular environment variable is that it is set automatically by KiCad on program start up, if it is not set already in the environment.

Definition at line 391 of file fp_lib_table.cpp.

Referenced by WIZARD_FPLIB_TABLE::LIBRARY::GetAutoPath(), DIALOG_CONFIG_EQUFILES::Init(), DIALOG_FP_LIB_TABLE::populateEnvironReadOnlyTable(), and WIZARD_FPLIB_TABLE::WIZARD_FPLIB_TABLE().

392 {
393  return "KISYSMOD";
394 }
LIB_TABLE_ROWS_ITER FP_LIB_TABLE_GRID::insert ( LIB_TABLE_ROWS_ITER  aIterator,
LIB_TABLE_ROW aRow 
)
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 69 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

70  {
71  return rows.insert( aIterator, aRow );
72  }
LIB_TABLE_ROWS rows
bool LIB_TABLE::InsertRow ( LIB_TABLE_ROW aRow,
bool  doReplace = false 
)
inherited

Function InsertRow.

adds aRow if it does not already exist or if doReplace is true. If doReplace is not true and the key for aRow already exists, the function fails and returns false.

The key for the table is the nickName, and all in this table must be unique.

Parameters
aRowis the new row to insert, or to forcibly add if doReplace is true.
doReplaceif true, means insert regardless of whether aRow's key already exists. If false, then fail if the key already exists.
Returns
bool - true if the operation succeeded.

Definition at line 336 of file lib_table_base.cpp.

References LIB_TABLE::ensureIndex(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE::nickIndex, and LIB_TABLE::rows.

Referenced by DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), InvokeFootprintWizard(), SYMBOL_LIB_TABLE::Parse(), and FP_LIB_TABLE::Parse().

337 {
338  ensureIndex();
339 
340  INDEX_CITER it = nickIndex.find( aRow->GetNickName() );
341 
342  if( it == nickIndex.end() )
343  {
344  rows.push_back( aRow );
345  nickIndex.insert( INDEX_VALUE( aRow->GetNickName(), rows.size() - 1 ) );
346  return true;
347  }
348 
349  if( doReplace )
350  {
351  rows.replace( it->second, aRow );
352  return true;
353  }
354 
355  return false;
356 }
void ensureIndex()
INDEX::const_iterator INDEX_CITER
LIB_TABLE_ROWS rows
INDEX::value_type INDEX_VALUE
const wxString & GetNickName() const
Function GetNickName.
INDEX nickIndex
this particular key is the nickName within each row.
bool LIB_TABLE_GRID::InsertRows ( size_t  aPos = 0,
size_t  aNumRows = 1 
)
inlineoverrideinherited

Definition at line 95 of file lib_table_grid.h.

References LIB_TABLE_GRID::begin(), LIB_TABLE_GRID::insert(), LIB_TABLE_GRID::makeNewRow(), and LIB_TABLE_GRID::size().

96  {
97  if( aPos < size() )
98  {
99  for( size_t i = 0; i < aNumRows; i++ )
100  {
101  insert( begin() + i, makeNewRow() );
102  }
103 
104  // use the (wxGridStringTable) source Luke.
105  if( GetView() )
106  {
107  wxGridTableMessage msg( this,
108  wxGRIDTABLE_NOTIFY_ROWS_INSERTED,
109  aPos,
110  aNumRows );
111 
112  GetView()->ProcessTableMessage( msg );
113  }
114 
115  return true;
116  }
117 
118  return false;
119  }
virtual LIB_TABLE_ROWS_ITER insert(LIB_TABLE_ROWS_ITER aIterator, LIB_TABLE_ROW *aRow)=0
virtual LIB_TABLE_ROW * makeNewRow()=0
virtual LIB_TABLE_ROWS_ITER begin()=0
virtual size_t size() const =0
bool LIB_TABLE::IsEmpty ( bool  aIncludeFallback = true)
inherited

Function IsEmpty.

Parameters
aIncludeFallbackis used to determine if the fallback table should be included in the test.
Returns
true if the footprint library table is empty.

Definition at line 233 of file lib_table_base.cpp.

References LIB_TABLE::fallBack, LIB_TABLE::IsEmpty(), and LIB_TABLE::rows.

Referenced by LIB_TABLE::IsEmpty(), PCB_EDIT_FRAME::LoadFootprints(), and FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib().

234 {
235  if( !aIncludeFallback || !fallBack )
236  return rows.empty();
237 
238  return rows.empty() && fallBack->IsEmpty( true );
239 }
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
bool IsEmpty(bool aIncludeFallback=true)
Function IsEmpty.
bool LIB_TABLE_GRID::IsEmptyCell ( int  aRow,
int  aCol 
)
inlineoverrideinherited

Definition at line 90 of file lib_table_grid.h.

References LIB_TABLE_GRID::GetValue().

91  {
92  return !GetValue( aRow, aCol );
93  }
wxString GetValue(int aRow, int aCol) override
bool FP_LIB_TABLE::IsFootprintLibWritable ( const wxString &  aNickname)
inherited

Function IsFootprintLibWritable.

returns true if the library given by aNickname is writable. (Often system libraries are read only because of where they are installed.)

Exceptions
IO_ERRORif no library at aLibraryPath exists.

Definition at line 336 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), LIB_TABLE_ROW::GetFullURI(), PLUGIN::IsFootprintLibWritable(), and FP_LIB_TABLE_ROW::plugin.

Referenced by FOOTPRINT_EDIT_FRAME::updateTitle().

337 {
338  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
339  wxASSERT( (PLUGIN*) row->plugin );
340  return row->plugin->IsFootprintLibWritable( row->GetFullURI( true ) );
341 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
virtual bool IsFootprintLibWritable(const wxString &aLibraryPath)
Function IsFootprintLibWritable returns true iff the library at aLibraryPath is writable.
Definition: plugin.cpp:114
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
void LIB_TABLE::Load ( const wxString &  aFileName)
inherited

Function Load.

loads the library table using the path defined by aFileName aFallBackTable.

Parameters
aFileNamecontains the full path to the s-expression file.
Exceptions
IO_ERRORif an error occurs attempting to load the footprint library table.

Definition at line 359 of file lib_table_base.cpp.

References LIB_TABLE::Parse().

Referenced by SYMBOL_LIB_TABLE::LoadGlobalTable(), FP_LIB_TABLE::LoadGlobalTable(), and PROJECT::PcbFootprintLibs().

361 {
362  // It's OK if footprint library tables are missing.
363  if( wxFileName::IsFileReadable( aFileName ) )
364  {
365  FILE_LINE_READER reader( aFileName );
366  LIB_TABLE_LEXER lexer( &reader );
367 
368  Parse( &lexer );
369  }
370 }
Class FILE_LINE_READER is a LINE_READER that reads from an open file.
Definition: richio.h:180
virtual void Parse(LIB_TABLE_LEXER *aLexer)=0
Function Parse.
Class LIB_TABLE_LEXER is an automatically generated class using the TokenList2DnsLexer.cmake technology, based on keywords provided by file: /home/kicad/workspace/kicad-doxygen/common/lib_table.keywords.
bool FP_LIB_TABLE::LoadGlobalTable ( FP_LIB_TABLE aTable)
staticinherited

Function LoadGlobalTable loads the global footprint library table into aTable.

This probably should be move into the application object when KiCad is changed to a single process application. This is the least painful solution for the time being.

Parameters
aTablethe FP_LIB_TABLE object to load.
Returns
true if the global library table exists and is loaded properly.
Exceptions
IO_ERRORif an error occurs attempting to load the footprint library table.

Definition at line 397 of file fp_lib_table.cpp.

References SEARCH_STACK::FindValidPath(), Format(), GetChars(), FP_LIB_TABLE::GetGlobalTableFileName(), global_tbl_name, Kiface(), KIFACE_I::KifaceSearch(), LIB_TABLE::Load(), LIB_TABLE::Save(), and THROW_IO_ERROR.

Referenced by CV::IFACE::OnKifaceStart(), and PCB::IFACE::OnKifaceStart().

398 {
399  bool tableExists = true;
400  wxFileName fn = GetGlobalTableFileName();
401 
402  if( !fn.FileExists() )
403  {
404  tableExists = false;
405 
406  if( !fn.DirExists() && !fn.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
407  {
408  THROW_IO_ERROR( wxString::Format( _( "Cannot create global library table path '%s'." ),
409  GetChars( fn.GetPath() ) ) );
410  }
411 
412  // Attempt to copy the default global file table from the KiCad
413  // template folder to the user's home configuration path.
414  wxString fileName = Kiface().KifaceSearch().FindValidPath( global_tbl_name );
415 
416  // The fallback is to create an empty global footprint table for the user to populate.
417  if( fileName.IsEmpty() || !::wxCopyFile( fileName, fn.GetFullPath(), false ) )
418  {
419  FP_LIB_TABLE emptyTable;
420 
421  emptyTable.Save( fn.GetFullPath() );
422  }
423  }
424 
425  aTable.Load( fn.GetFullPath() );
426 
427  return tableExists;
428 }
static const wxChar global_tbl_name[]
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
SEARCH_STACK & KifaceSearch()
Only for DSO specific 'non-library' files.
Definition: kiface_i.h:127
void Save(const wxString &aFileName) const
Function Save.
void Load(const wxString &aFileName)
Function Load.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
wxString FindValidPath(const wxString &aFileName) const
Definition: search_stack.h:71
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
static wxString GetGlobalTableFileName()
Function GetGlobalTableFileName.
LIB_TABLE_ROW* FP_LIB_TABLE_GRID::makeNewRow ( )
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 62 of file dialog_fp_lib_table.cpp.

63  {
64  return dynamic_cast< LIB_TABLE_ROW* >( new FP_LIB_TABLE_ROW );
65  }
Class LIB_TABLE_ROW.
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
bool FP_LIB_TABLE::operator!= ( const FP_LIB_TABLE r) const
inlineinherited

Definition at line 128 of file fp_lib_table.h.

128 { return !( *this == r ); }
bool LIB_TABLE::operator!= ( const LIB_TABLE r) const
inlineinherited

Definition at line 350 of file lib_table_base.h.

350 { return !( *this == r ); }
bool FP_LIB_TABLE::operator== ( const FP_LIB_TABLE aFpTable) const
inherited

Definition at line 202 of file fp_lib_table.cpp.

References LIB_TABLE::rows.

203 {
204  if( rows.size() == aFpTable.rows.size() )
205  {
206  for( unsigned i = 0; i < rows.size(); ++i )
207  {
208  if( (FP_LIB_TABLE_ROW&)rows[i] != (FP_LIB_TABLE_ROW&)aFpTable.rows[i] )
209  return false;
210  }
211 
212  return true;
213  }
214 
215  return false;
216 }
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
LIB_TABLE_ROWS rows
bool LIB_TABLE::operator== ( const LIB_TABLE r) const
inlineinherited

Definition at line 334 of file lib_table_base.h.

References LIB_TABLE::rows.

335  {
336  if( rows.size() == r.rows.size() )
337  {
338  unsigned i;
339 
340  for( i = 0; i < rows.size() && rows[i] == r.rows[i]; ++i )
341  ;
342 
343  if( i == rows.size() )
344  return true;
345  }
346 
347  return false;
348  }
LIB_TABLE_ROWS rows
void FP_LIB_TABLE::Parse ( LIB_TABLE_LEXER aLexer)
overridevirtualinherited

Function Parse.

Parses the LIB_TABLE_LEXER s-expression library table format into the appropriate LIB_TABLE_ROW objects.

Parameters
aLexeris the lexer to parse.
Exceptions
IO_ERRORif an I/O error occurs during parsing.
PARSER_ERRORif the lexer format to parse is invalid.
boost::bad_pointerif an any attempt to add an invalid pointer to the boost::ptr_vector.
boost::bad_indexif an index outside the row table bounds is accessed.

Implements LIB_TABLE.

Definition at line 67 of file fp_lib_table.cpp.

References DSNLEXER::CurLineNumber(), LIB_TABLE_LEXER::CurTok(), DSNLEXER::Duplicate(), DSNLEXER::Expecting(), Format(), DSNLEXER::FromUTF8(), GetChars(), LIB_TABLE::InsertRow(), DSNLEXER::NeedLEFT(), DSNLEXER::NeedRIGHT(), LIB_TABLE_LEXER::NeedSYMBOLorNUMBER(), LIB_TABLE_LEXER::NextTok(), FP_LIB_TABLE_T::T_descr, DSN::T_EOF, FP_LIB_TABLE_T::T_fp_lib_table, DSN::T_LEFT, FP_LIB_TABLE_T::T_lib, TLIB_T::T_name, FP_LIB_TABLE_T::T_options, DSN::T_RIGHT, DSN::T_type, FP_LIB_TABLE_T::T_uri, THROW_IO_ERROR, and DSNLEXER::Unexpected().

Referenced by FP_GRID_TRICKS::paste_text().

68 {
69  T tok;
70  wxString errMsg; // to collect error messages
71 
72  // This table may be nested within a larger s-expression, or not.
73  // Allow for parser of that optional containing s-epression to have looked ahead.
74  if( in->CurTok() != T_fp_lib_table )
75  {
76  in->NeedLEFT();
77 
78  if( ( tok = in->NextTok() ) != T_fp_lib_table )
79  in->Expecting( T_fp_lib_table );
80  }
81 
82  while( ( tok = in->NextTok() ) != T_RIGHT )
83  {
84  std::unique_ptr< FP_LIB_TABLE_ROW > row( new FP_LIB_TABLE_ROW );
85 
86  if( tok == T_EOF )
87  in->Expecting( T_RIGHT );
88 
89  if( tok != T_LEFT )
90  in->Expecting( T_LEFT );
91 
92  // in case there is a "row integrity" error, tell where later.
93  int lineNum = in->CurLineNumber();
94 
95  if( ( tok = in->NextTok() ) != T_lib )
96  in->Expecting( T_lib );
97 
98  // (name NICKNAME)
99  in->NeedLEFT();
100 
101  if( ( tok = in->NextTok() ) != T_name )
102  in->Expecting( T_name );
103 
104  in->NeedSYMBOLorNUMBER();
105 
106  row->SetNickName( in->FromUTF8() );
107 
108  in->NeedRIGHT();
109 
110  // After (name), remaining (lib) elements are order independent, and in
111  // some cases optional.
112  bool sawType = false;
113  bool sawOpts = false;
114  bool sawDesc = false;
115  bool sawUri = false;
116 
117  while( ( tok = in->NextTok() ) != T_RIGHT )
118  {
119  if( tok == T_EOF )
120  in->Unexpected( T_EOF );
121 
122  if( tok != T_LEFT )
123  in->Expecting( T_LEFT );
124 
125  tok = in->NeedSYMBOLorNUMBER();
126 
127  switch( tok )
128  {
129  case T_uri:
130  if( sawUri )
131  in->Duplicate( tok );
132  sawUri = true;
133  in->NeedSYMBOLorNUMBER();
134  row->SetFullURI( in->FromUTF8() );
135  break;
136 
137  case T_type:
138  if( sawType )
139  in->Duplicate( tok );
140  sawType = true;
141  in->NeedSYMBOLorNUMBER();
142  row->SetType( in->FromUTF8() );
143  break;
144 
145  case T_options:
146  if( sawOpts )
147  in->Duplicate( tok );
148  sawOpts = true;
149  in->NeedSYMBOLorNUMBER();
150  row->SetOptions( in->FromUTF8() );
151  break;
152 
153  case T_descr:
154  if( sawDesc )
155  in->Duplicate( tok );
156  sawDesc = true;
157  in->NeedSYMBOLorNUMBER();
158  row->SetDescr( in->FromUTF8() );
159  break;
160 
161  default:
162  in->Unexpected( tok );
163  }
164 
165  in->NeedRIGHT();
166  }
167 
168  if( !sawType )
169  in->Expecting( T_type );
170 
171  if( !sawUri )
172  in->Expecting( T_uri );
173 
174  // all nickNames within this table fragment must be unique, so we do not
175  // use doReplace in InsertRow(). (However a fallBack table can have a
176  // conflicting nickName and ours will supercede that one since in
177  // FindLib() we search this table before any fall back.)
178  wxString nickname = row->GetNickName(); // store it to be able to used it
179  // after row deletion if an error occurs
180  LIB_TABLE_ROW* tmp = row.release();
181 
182  if( !InsertRow( tmp ) )
183  {
184  delete tmp; // The table did not take ownership of the row.
185 
186  wxString msg = wxString::Format(
187  _( "Duplicate library nickname '%s' found in footprint library "
188  "table file line %d" ), GetChars( nickname ), lineNum );
189 
190  if( !errMsg.IsEmpty() )
191  errMsg << '\n';
192 
193  errMsg << msg;
194  }
195  }
196 
197  if( !errMsg.IsEmpty() )
198  THROW_IO_ERROR( errMsg );
199 }
Class LIB_TABLE_ROW.
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Function InsertRow.
T
enum T contains all this lexer's tokens.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
PROPERTIES * LIB_TABLE::ParseOptions ( const std::string &  aOptionsList)
staticinherited

Function ParseOptions.

parses aOptionsList and places the result into a PROPERTIES object which is returned. If the options field is empty, then the returned PROPERTIES will be a NULL pointer.

Typically aOptionsList comes from the "options" field within a LIB_TABLE_ROW and the format is simply a comma separated list of name value pairs. e.g.: [name1[=value1][|name2[=value2]]] etc. When using the UI to create or edit a library table, this formatting is handled for you.

Definition at line 413 of file lib_table_base.cpp.

References name, and OPT_SEP.

Referenced by DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), and LIB_TABLE_ROW::SetOptions().

414 {
415  if( aOptionsList.size() )
416  {
417  const char* cp = &aOptionsList[0];
418  const char* end = cp + aOptionsList.size();
419 
420  PROPERTIES props;
421  std::string pair;
422 
423  // Parse all name=value pairs
424  while( cp < end )
425  {
426  pair.clear();
427 
428  // Skip leading white space.
429  while( cp < end && isspace( *cp ) )
430  ++cp;
431 
432  // Find the end of pair/field
433  while( cp < end )
434  {
435  if( *cp == '\\' && cp + 1 < end && cp[1] == OPT_SEP )
436  {
437  ++cp; // skip the escape
438  pair += *cp++; // add the separator
439  }
440  else if( *cp == OPT_SEP )
441  {
442  ++cp; // skip the separator
443  break; // process the pair
444  }
445  else
446  pair += *cp++;
447  }
448 
449  // stash the pair
450  if( pair.size() )
451  {
452  // first equals sign separates 'name' and 'value'.
453  size_t eqNdx = pair.find( '=' );
454 
455  if( eqNdx != pair.npos )
456  {
457  std::string name = pair.substr( 0, eqNdx );
458  std::string value = pair.substr( eqNdx + 1 );
459  props[name] = value;
460  }
461  else
462  props[pair] = ""; // property is present, but with no value.
463  }
464  }
465 
466  if( props.size() )
467  return new PROPERTIES( props );
468  }
469 
470  return NULL;
471 }
std::vector< PROPERTY > PROPERTIES
Definition: specctra.h:184
Class PROPERTIES is a name/value tuple with unique names and optional values.
Definition: properties.h:34
const char * name
#define OPT_SEP
options separator character
void FP_LIB_TABLE::PrefetchLib ( const wxString &  aNickname)
inherited

Function PrefetchLib If possible, prefetches the specified library (e.g.

performing downloads). Does not parse. Threadsafe.

This is a no-op for libraries that cannot be prefetched.

Parameters
aNicknameis a locator for the library; it is a name in LIB_TABLE_ROW.
Exceptions
IO_ERRORif there is an error prefetching the library.

Definition at line 239 of file fp_lib_table.cpp.

References FP_LIB_TABLE::FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), FP_LIB_TABLE_ROW::plugin, and PLUGIN::PrefetchLib().

Referenced by FOOTPRINT_LIST_IMPL::loader_job().

240 {
241  const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
242  wxASSERT( (PLUGIN*) row->plugin );
243  row->plugin->PrefetchLib( row->GetFullURI( true ), row->GetProperties() );
244 }
virtual void PrefetchLib(const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Function PrefetchLib If possible, prefetches the specified library (e.g.
Definition: plugin.cpp:69
Class FP_LIB_TABLE_ROW.
Definition: fp_lib_table.h:42
const PROPERTIES * GetProperties() const
Function GetProperties.
const wxString GetFullURI(bool aSubstituted=false) const
Function GetFullURI.
PLUGIN::RELEASER plugin
Definition: fp_lib_table.h:98
const FP_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Function FindRow.
Class PLUGIN is a base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:193
void FP_LIB_TABLE_GRID::push_back ( LIB_TABLE_ROW aRow)
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 74 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

74 { rows.push_back( aRow ); }
LIB_TABLE_ROWS rows
void LIB_TABLE::reindex ( )
inlineprotectedinherited

Definition at line 486 of file lib_table_base.h.

References LIB_TABLE::nickIndex, and LIB_TABLE::rows.

Referenced by LIB_TABLE::ensureIndex(), and DIALOG_FP_LIB_TABLE::onOKButtonClick().

487  {
488  nickIndex.clear();
489 
490  for( LIB_TABLE_ROWS_ITER it = rows.begin(); it != rows.end(); ++it )
491  nickIndex.insert( INDEX_VALUE( it->GetNickName(), it - rows.begin() ) );
492  }
LIB_TABLE_ROWS rows
INDEX::value_type INDEX_VALUE
LIB_TABLE_ROWS::iterator LIB_TABLE_ROWS_ITER
INDEX nickIndex
this particular key is the nickName within each row.
void LIB_TABLE::Save ( const wxString &  aFileName) const
inherited

Function Save.

writes this library table to aFileName in s-expression form.

Parameters
aFileNameis the name of the file to write to.

Definition at line 373 of file lib_table_base.cpp.

References LIB_TABLE::Format().

Referenced by SYMBOL_LIB_TABLE::LoadGlobalTable(), FP_LIB_TABLE::LoadGlobalTable(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), PCB_EDIT_FRAME::Process_Config(), and FOOTPRINT_EDIT_FRAME::ProcessPreferences().

374 {
375  FILE_OUTPUTFORMATTER sf( aFileName );
376  Format( &sf, 0 );
377 }
virtual void Format(OUTPUTFORMATTER *aOutput, int aIndentLevel) const =0
Generate the table in s-expression format to aOutput with an indention level of aIndentLevel.
Class FILE_OUTPUTFORMATTER may be used for text file output.
Definition: richio.h:492
void LIB_TABLE_GRID::SetValue ( int  aRow,
int  aCol,
const wxString &  aValue 
)
inlineoverrideinherited

Definition at line 73 of file lib_table_grid.h.

References LIB_TABLE_GRID::at(), COL_DESCR, COL_NICKNAME, COL_OPTIONS, COL_TYPE, COL_URI, LIB_TABLE_ROW::SetDescr(), LIB_TABLE_ROW::SetFullURI(), LIB_TABLE_ROW::SetNickName(), LIB_TABLE_ROW::SetOptions(), LIB_TABLE_ROW::SetType(), and LIB_TABLE_GRID::size().

Referenced by DIALOG_FP_LIB_TABLE::OnClickLibraryWizard(), and DIALOG_FP_LIB_TABLE::verifyTables().

74  {
75  if( aRow < (int) size() )
76  {
77  LIB_TABLE_ROW* r = at( (size_t) aRow );
78 
79  switch( aCol )
80  {
81  case COL_NICKNAME: r->SetNickName( aValue ); break;
82  case COL_URI: r->SetFullURI( aValue ); break;
83  case COL_TYPE: r->SetType( aValue ); break;
84  case COL_OPTIONS: r->SetOptions( aValue ); break;
85  case COL_DESCR: r->SetDescr( aValue ); break;
86  }
87  }
88  }
Class LIB_TABLE_ROW.
virtual void SetType(const wxString &aType)=0
Function SetType.
virtual LIB_TABLE_ROW * at(size_t aIndex)=0
virtual size_t size() const =0
void SetFullURI(const wxString &aFullURI)
Function SetFullURI.
void SetNickName(const wxString &aNickName)
Function SetNickName.
void SetOptions(const wxString &aOptions)
Function SetOptions.
void SetDescr(const wxString &aDescr)
Function SetDescr.
size_t FP_LIB_TABLE_GRID::size ( ) const
inlineoverrideprotectedvirtual

Implements LIB_TABLE_GRID.

Definition at line 60 of file dialog_fp_lib_table.cpp.

References LIB_TABLE::rows.

60 { return rows.size(); }
LIB_TABLE_ROWS rows

Friends And Related Function Documentation

friend class FP_GRID_TRICKS
friend

Definition at line 55 of file dialog_fp_lib_table.cpp.

Member Data Documentation

LIB_TABLE* LIB_TABLE::fallBack
protectedinherited
INDEX LIB_TABLE::nickIndex
protectedinherited

this particular key is the nickName within each row.

Definition at line 512 of file lib_table_base.h.

Referenced by LIB_TABLE::Clear(), LIB_TABLE::ensureIndex(), LIB_TABLE::findRow(), LIB_TABLE::InsertRow(), and LIB_TABLE::reindex().


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