KiCad PCB EDA Suite
SYMBOL_LIB_TABLE Class Reference

#include <symbol_lib_table.h>

Inheritance diagram for SYMBOL_LIB_TABLE:
LIB_TABLE PROJECT::_ELEM SYMBOL_LIB_TABLE_GRID

Public Types

enum  SAVE_T { SAVE_OK, SAVE_SKIPPED }
 The set of return values from SaveSymbol() below. More...
 

Public Member Functions

virtual void Parse (LIB_TABLE_LEXER *aLexer) override
 Parse the #LIB_TABLE_LEXER s-expression library table format into the appropriate LIB_TABLE_ROW objects. 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...
 
 SYMBOL_LIB_TABLE (SYMBOL_LIB_TABLE *aFallBackTable=NULL)
 Build a symbol library table by pre-pending this table fragment in front of aFallBackTable. More...
 
SYMBOL_LIB_TABLE_ROWFindRow (const wxString &aNickName)
 Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table fragment. More...
 
int GetModifyHash ()
 
size_t GetSymbolCount (const wxString &aNickname)
 Return the number of symbols in the symbol library mapped to aNickname. More...
 
void EnumerateSymbolLib (const wxString &aNickname, wxArrayString &aAliasNames, bool aPowerSymbolsOnly=false)
 Return a list of symbol alias names contained within the library given by aNickname. More...
 
void LoadSymbolLib (std::vector< LIB_ALIAS * > &aAliasList, const wxString &aNickname, bool aPowerSymbolsOnly=false)
 
LIB_ALIASLoadSymbol (const wxString &aNickname, const wxString &aAliasName)
 Load a LIB_ALIAS having aAliasName from the library given by aNickname. More...
 
LIB_ALIASLoadSymbol (const LIB_ID &aLibId)
 
SAVE_T SaveSymbol (const wxString &aNickname, const LIB_PART *aSymbol, bool aOverwrite=true)
 Write aSymbol to an existing library given by aNickname. More...
 
void DeleteSymbol (const wxString &aNickname, const wxString &aSymbolName)
 Deletes the aSymbolName from the library given by aNickname. More...
 
void DeleteAlias (const wxString &aNickname, const wxString &aAliasName)
 Delete aAliasName from the library at aLibraryPath. More...
 
bool IsSymbolLibWritable (const wxString &aNickname)
 Return true if the library given by aNickname is writable. More...
 
void DeleteSymbolLib (const wxString &aNickname)
 
void CreateSymbolLib (const wxString &aNickname)
 
LIB_ALIASLoadSymbolWithOptionalNickname (const LIB_ID &aId)
 Load a LIB_PART having aFootprintId with possibly an empty library nickname. More...
 
void Clear ()
 Delete all rows. More...
 
bool operator== (const LIB_TABLE &r) const
 
bool operator!= (const LIB_TABLE &r) const
 
int GetCount ()
 
LIB_TABLE_ROWAt (int aIndex)
 
bool IsEmpty (bool aIncludeFallback=true)
 Return true if the table is empty. More...
 
const wxString GetDescription (const wxString &aNickname)
 
bool HasLibrary (const wxString &aNickname, bool aCheckEnabled=false) const
 Test for the existence of aNickname in the library table. More...
 
std::vector< wxString > GetLogicalLibs ()
 Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE. More...
 
wxString GetFullURI (const wxString &aLibNickname, bool aExpandEnvVars=true) const
 Return the full URI of the library mapped to aLibNickname. More...
 
bool InsertRow (LIB_TABLE_ROW *aRow, bool doReplace=false)
 Adds aRow if it does not already exist or if doReplace is true. More...
 
const LIB_TABLE_ROWFindRowByURI (const wxString &aURI)
 
void Load (const wxString &aFileName)
 Load the library table using the path defined by aFileName aFallBackTable. More...
 
void Save (const wxString &aFileName) const
 Write this library table to aFileName in s-expression form. More...
 

Static Public Member Functions

static bool LoadGlobalTable (SYMBOL_LIB_TABLE &aTable)
 Load the global symbol library table into aTable. More...
 
static wxString GetGlobalTableFileName ()
 Fetch the global symbol library table file name. More...
 
static const wxString GlobalPathEnvVariableName ()
 Return the name of the environment variable used to hold the directory of locally installed "KiCad sponsored" system symbol libraries. More...
 
static SYMBOL_LIB_TABLEGetGlobalLibTable ()
 
static const wxString & GetSymbolLibTableFileName ()
 
static PROPERTIESParseOptions (const std::string &aOptionsList)
 Parses aOptionsList and places the result into a PROPERTIES object which is returned. More...
 
static UTF8 FormatOptions (const PROPERTIES *aProperties)
 Returns a list of options from the aProperties parameter. More...
 
static const wxString ExpandSubstitutions (const wxString &aString)
 Replaces any environment variable references with their values and is here to fully embellish the TABLE_ROW::uri in a platform independent way. More...
 

Static Public Attributes

static const char * PropPowerSymsOnly = "pwr_sym_only"
 
static const char * PropNonPowerSymsOnly = "non_pwr_sym_only"
 

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_ROWfindRow (const wxString &aNickname) const
 Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment, else NULL. More...
 
LIB_TABLE_ROWfindRow (const wxString &aNickname)
 
void reindex ()
 
void ensureIndex ()
 

Protected Attributes

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

Static Private Attributes

static int m_modifyHash = 1
 helper for GetModifyHash() More...
 

Friends

class SYMBOL_LIB_TABLE_GRID
 
class DIALOG_SYMBOL_LIB_TABLE
 

Detailed Description

Definition at line 102 of file symbol_lib_table.h.

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 477 of file lib_table_base.h.

typedef INDEX::const_iterator LIB_TABLE::INDEX_CITER
protectedinherited

Definition at line 479 of file lib_table_base.h.

typedef INDEX::iterator LIB_TABLE::INDEX_ITER
protectedinherited

Definition at line 478 of file lib_table_base.h.

typedef INDEX::value_type LIB_TABLE::INDEX_VALUE
protectedinherited

Definition at line 480 of file lib_table_base.h.

Member Enumeration Documentation

The set of return values from SaveSymbol() below.

Enumerator
SAVE_OK 
SAVE_SKIPPED 

Definition at line 189 of file symbol_lib_table.h.

Constructor & Destructor Documentation

SYMBOL_LIB_TABLE::SYMBOL_LIB_TABLE ( SYMBOL_LIB_TABLE aFallBackTable = NULL)

Build a symbol library table by pre-pending this table fragment in front of aFallBackTable.

Loading of this table fragment is done by using Parse().

Parameters
aFallBackTableis another SYMBOL_LIB_TABLE which is searched only when a row is not found in this table. No ownership is taken of aFallBackTable.

Definition at line 69 of file symbol_lib_table.cpp.

69  :
70  LIB_TABLE( aFallBackTable )
71 {
72  // not copying fall back, simply search aFallBackTable separately
73  // if "nickName not found".
74 }
LIB_TABLE(LIB_TABLE *aFallBackTable=NULL)
Build a library table by pre-pending this table fragment in front of aFallBackTable.

Member Function Documentation

LIB_TABLE_ROW* LIB_TABLE::At ( int  aIndex)
inlineinherited

Definition at line 338 of file lib_table_base.h.

References LIB_TABLE_ROW::GetFullURI(), Load(), and Save.

Referenced by SYMBOL_GRID_TRICKS::paste_text(), and FP_GRID_TRICKS::paste_text().

338 { return &rows[aIndex]; }
LIB_TABLE_ROWS rows
void LIB_TABLE::Clear ( )
inlineinherited

Delete all rows.

Definition at line 312 of file lib_table_base.h.

Referenced by DIALOG_SYMBOL_LIB_TABLE::TransferDataFromWindow().

313  {
314  rows.clear();
315  nickIndex.clear();
316  }
LIB_TABLE_ROWS rows
INDEX nickIndex
this particular key is the nickName within each row.
void SYMBOL_LIB_TABLE::CreateSymbolLib ( const wxString &  aNickname)

Definition at line 430 of file symbol_lib_table.cpp.

References SCH_PLUGIN::CreateSymbolLib(), FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.

Referenced by LIB_MANAGER::addLibrary().

431 {
432  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
433  wxCHECK( row && row->plugin, /* void */ );
434  row->plugin->CreateSymbolLib( row->GetFullURI( true ), row->GetProperties() );
435 }
virtual void CreateSymbolLib(const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Create a new empty symbol library at aLibraryPath.
Definition: sch_plugin.cpp:126
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
void SYMBOL_LIB_TABLE::DeleteAlias ( const wxString &  aNickname,
const wxString &  aAliasName 
)

Delete aAliasName from the library at aLibraryPath.

If aAliasName refers the the root LIB_PART object, the part is renamed to the next or previous LIB_ALIAS in the LIB_PART if one exists. If the LIB_ALIAS is the last alias referring to the root LIB_PART, the LIB_PART is also removed from the library.

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

Definition at line 405 of file symbol_lib_table.cpp.

References SCH_PLUGIN::DeleteAlias(), FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.

Referenced by LIB_MANAGER::FlushLibrary().

406 {
407  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
408  wxCHECK( row && row->plugin, /* void */ );
409  return row->plugin->DeleteAlias( row->GetFullURI( true ), aAliasName,
410  row->GetProperties() );
411 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
virtual void DeleteAlias(const wxString &aLibraryPath, const wxString &aAliasName, const PROPERTIES *aProperties=NULL)
Delete aAliasName from the library at aLibraryPath.
Definition: sch_plugin.cpp:110
void SYMBOL_LIB_TABLE::DeleteSymbol ( const wxString &  aNickname,
const wxString &  aSymbolName 
)

Deletes the aSymbolName from the library given by aNickname.

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW.
aSymbolNameis the name of a symbol 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 396 of file symbol_lib_table.cpp.

References SCH_PLUGIN::DeleteSymbol(), FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.

397 {
398  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
399  wxCHECK( row && row->plugin, /* void */ );
400  return row->plugin->DeleteSymbol( row->GetFullURI( true ), aSymbolName,
401  row->GetProperties() );
402 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
virtual void DeleteSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const PROPERTIES *aProperties=NULL)
Delete the entire LIB_PART associated with aAliasName from the library aLibraryPath.
Definition: sch_plugin.cpp:118
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
void SYMBOL_LIB_TABLE::DeleteSymbolLib ( const wxString &  aNickname)

Definition at line 422 of file symbol_lib_table.cpp.

References SCH_PLUGIN::DeleteSymbolLib(), FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetProperties(), and SYMBOL_LIB_TABLE_ROW::plugin.

423 {
424  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
425  wxCHECK( row && row->plugin, /* void */ );
426  row->plugin->DeleteSymbolLib( row->GetFullURI( true ), row->GetProperties() );
427 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
virtual bool DeleteSymbolLib(const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Delete an existing symbol library and returns true if successful, or if library does not exist return...
Definition: sch_plugin.cpp:133
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
void LIB_TABLE::ensureIndex ( )
inlineprotectedinherited

Definition at line 465 of file lib_table_base.h.

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

466  {
467  // The dialog lib table editor may not maintain the nickIndex.
468  // Lazy indexing may be required. To handle lazy indexing, we must enforce
469  // that "nickIndex" is either empty or accurate, but never inaccurate.
470  if( !nickIndex.size() )
471  reindex();
472  }
void reindex()
INDEX nickIndex
this particular key is the nickName within each row.
void SYMBOL_LIB_TABLE::EnumerateSymbolLib ( const wxString &  aNickname,
wxArrayString &  aAliasNames,
bool  aPowerSymbolsOnly = false 
)

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

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW.
aAliasNamesis a reference to an array for the alias names.
aPowerSymbolsOnlyis a flag to enumerate only power symbols.
Exceptions
IO_ERRORif the library cannot be found or loaded.

Definition at line 271 of file symbol_lib_table.cpp.

References SCH_PLUGIN::EnumerateSymbolLib(), FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetOptions(), LIB_TABLE_ROW::GetProperties(), SYMBOL_LIB_TABLE_ROW::plugin, PropPowerSymsOnly, and LIB_TABLE_ROW::SetOptions().

Referenced by LIB_MANAGER::FlushLibrary(), LIB_MANAGER::GetAliasNames(), and LIB_MANAGER::getOriginalParts().

273 {
274  SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
275  wxCHECK( row && row->plugin, /* void */ );
276 
277  wxString options = row->GetOptions();
278 
279  if( aPowerSymbolsOnly )
280  row->SetOptions( row->GetOptions() + " " + PropPowerSymsOnly );
281 
282  row->plugin->EnumerateSymbolLib( aAliasNames, row->GetFullURI( true ), row->GetProperties() );
283 
284  if( aPowerSymbolsOnly )
285  row->SetOptions( options );
286 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
virtual void EnumerateSymbolLib(wxArrayString &aAliasNameList, const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Populate a list of LIB_PART alias names contained within the library aLibraryPath.
Definition: sch_plugin.cpp:75
const wxString & GetOptions() const
Return the options string, which may hold a password or anything else needed to instantiate the under...
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
void SetOptions(const wxString &aOptions)
Change the library options strings.
static const char * PropPowerSymsOnly
const wxString LIB_TABLE::ExpandSubstitutions ( const wxString &  aString)
staticinherited

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 548 of file lib_table_base.cpp.

References ExpandEnvVarSubstitutions().

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

549 {
550  return ExpandEnvVarSubstitutions( aString );
551 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString)
Replace any environment variable references with their values.
Definition: common.cpp:255
SYMBOL_LIB_TABLE_ROW * SYMBOL_LIB_TABLE::FindRow ( const wxString &  aNickName)

Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table fragment.

The SCH_PLUGIN is loaded and attached to the "plugin" fieldf the SYMBOL_LIB_TABLE_ROW if not already loaded.

Parameters
aNickNameis the name of the row to find.
Returns
the row found or NULL if aNickName was not found.
Exceptions
IO_ERRORif aNickName cannot be found.

Definition at line 289 of file symbol_lib_table.cpp.

References LIB_TABLE::findRow(), Format(), GetChars(), SYMBOL_LIB_TABLE_ROW::plugin, SYMBOL_LIB_TABLE_ROW::setPlugin(), THROW_IO_ERROR, and SYMBOL_LIB_TABLE_ROW::type.

Referenced by SCH_EDIT_FRAME::AppendSchematic(), CreateSymbolLib(), DeleteAlias(), DeleteSymbol(), DeleteSymbolLib(), EnumerateSymbolLib(), LIB_MANAGER::GetLibrary(), GetModifyHash(), IsSymbolLibWritable(), LoadSymbol(), LoadSymbolLib(), and SaveSymbol().

291 {
292  SYMBOL_LIB_TABLE_ROW* row = dynamic_cast< SYMBOL_LIB_TABLE_ROW* >( findRow( aNickname ) );
293 
294  if( !row )
295  {
296  wxString msg = wxString::Format(
297  _( "sym-lib-table files contain no library with nickname \"%s\"" ),
298  GetChars( aNickname ) );
299 
300  THROW_IO_ERROR( msg );
301  }
302 
303  // We've been 'lazy' up until now, but it cannot be deferred any longer,
304  // instantiate a PLUGIN of the proper kind if it is not already in this
305  // SYMBOL_LIB_TABLE_ROW.
306  if( !row->plugin )
307  row->setPlugin( SCH_IO_MGR::FindPlugin( row->type ) );
308 
309  return row;
310 }
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
void setPlugin(SCH_PLUGIN *aPlugin)
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment...
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
LIB_TABLE_ROW * LIB_TABLE::findRow ( const wxString &  aNickname) const
protectedinherited

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

Definition at line 291 of file lib_table_base.cpp.

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

Referenced by FP_LIB_TABLE::FindRow(), FindRow(), LIB_TABLE::GetDescription(), LIB_TABLE::GetFullURI(), GetSymbolCount(), and LIB_TABLE::HasLibrary().

292 {
293  LIB_TABLE* cur = (LIB_TABLE*) this;
294 
295  do
296  {
297  cur->ensureIndex();
298 
299  INDEX_CITER it = cur->nickIndex.find( aNickName );
300 
301  if( it != cur->nickIndex.end() )
302  {
303  return &cur->rows[it->second]; // found
304  }
305 
306  // not found, search fall back table(s), if any
307  } while( ( cur = cur->fallBack ) != 0 );
308 
309  return NULL; // not found
310 }
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.
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.
LIB_TABLE_ROW * LIB_TABLE::findRow ( const wxString &  aNickname)
protectedinherited

Definition at line 313 of file lib_table_base.cpp.

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

314 {
315  LIB_TABLE* cur = (LIB_TABLE*) this;
316 
317  do
318  {
319  cur->ensureIndex();
320 
321  INDEX_ITER it = cur->nickIndex.find( aNickName );
322 
323  if( it != cur->nickIndex.end() )
324  {
325  return &cur->rows[it->second]; // found
326  }
327 
328  // not found, search fall back table(s), if any
329  } while( ( cur = cur->fallBack ) != 0 );
330 
331  return NULL; // not found
332 }
void ensureIndex()
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
INDEX::iterator INDEX_ITER
INDEX nickIndex
this particular key is the nickName within each row.
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.
const LIB_TABLE_ROW * LIB_TABLE::FindRowByURI ( const wxString &  aURI)
inherited
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 335 of file lib_table_base.cpp.

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

336 {
337  LIB_TABLE* cur = this;
338 
339  do
340  {
341  cur->ensureIndex();
342 
343  for( unsigned i = 0; i < cur->rows.size(); i++ )
344  {
345  wxString tmp = cur->rows[i].GetFullURI( true );
346 
347  if( tmp.Find( "://" ) != wxNOT_FOUND )
348  {
349  if( tmp == aURI )
350  return &cur->rows[i]; // found as URI
351  }
352  else
353  {
354  wxFileName fn = aURI;
355 
356  // This will also test if the file is a symlink so if we are comparing
357  // a symlink to the same real file, the comparison will be true. See
358  // wxFileName::SameAs() in the wxWidgets source.
359  if( fn == wxFileName( tmp ) )
360  return &cur->rows[i]; // found as full path and file name
361  }
362  }
363 
364  // not found, search fall back table(s), if any
365  } while( ( cur = cur->fallBack ) != 0 );
366 
367  return NULL; // not found
368 }
void ensureIndex()
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
size_t i
Definition: json11.cpp:597
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.
void SYMBOL_LIB_TABLE::Format ( OUTPUTFORMATTER aOutput,
int  aIndentLevel 
) const
overridevirtual

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 225 of file symbol_lib_table.cpp.

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

Referenced by DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EAGLE_PLUGIN::Load(), and SCH_BASE_FRAME::saveSymbolLibTables().

226 {
227  aOutput->Print( aIndentLevel, "(sym_lib_table\n" );
228 
229  for( LIB_TABLE_ROWS_CITER it = rows.begin(); it != rows.end(); ++it )
230  {
231  it->Format( aOutput, aIndentLevel+1 );
232  }
233 
234  aOutput->Print( aIndentLevel, ")\n" );
235 }
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:404
UTF8 LIB_TABLE::FormatOptions ( const PROPERTIES aProperties)
staticinherited

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 510 of file lib_table_base.cpp.

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

Referenced by DIALOG_FP_PLUGIN_OPTIONS::makeResult().

511 {
512  UTF8 ret;
513 
514  if( aProperties )
515  {
516  for( PROPERTIES::const_iterator it = aProperties->begin(); it != aProperties->end(); ++it )
517  {
518  const std::string& name = it->first;
519 
520  const UTF8& value = it->second;
521 
522  if( ret.size() )
523  ret += OPT_SEP;
524 
525  ret += name;
526 
527  // the separation between name and value is '='
528  if( value.size() )
529  {
530  ret += '=';
531 
532  for( std::string::const_iterator si = value.begin(); si != value.end(); ++si )
533  {
534  // escape any separator in the value.
535  if( *si == OPT_SEP )
536  ret += '\\';
537 
538  ret += *si;
539  }
540  }
541  }
542  }
543 
544  return ret;
545 }
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:197
std::string::const_iterator begin() const
Definition: utf8.h:196
const char * name
Definition: DXF_plotter.cpp:61
#define OPT_SEP
options separator character
int LIB_TABLE::GetCount ( )
inlineinherited

Definition at line 336 of file lib_table_base.h.

Referenced by SYMBOL_GRID_TRICKS::paste_text(), and FP_GRID_TRICKS::paste_text().

336 { return rows.size(); }
LIB_TABLE_ROWS rows
const wxString LIB_TABLE::GetDescription ( const wxString &  aNickname)
inherited
Returns
the library description from aNickname, or an empty string if aNickname does not exist.

Definition at line 252 of file lib_table_base.cpp.

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

Referenced by CMP_TREE_MODEL_ADAPTER::AddAliasList(), CMP_TREE_MODEL_ADAPTER::AddLibrary(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), and PCB_BASE_FRAME::SelectLibrary().

253 {
254  // use "no exception" form of find row:
255  const LIB_TABLE_ROW* row = findRow( aNickname );
256 
257  if( row )
258  return row->GetDescr();
259  else
260  return wxEmptyString;
261 }
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE...
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment...
const wxString & GetDescr() const
Return the description of the library referenced by this row.
wxString LIB_TABLE::GetFullURI ( const wxString &  aLibNickname,
bool  aExpandEnvVars = true 
) const
inherited

Return the full URI of the library mapped to aLibNickname.

Definition at line 278 of file lib_table_base.cpp.

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

Referenced by SCH_EDIT_FRAME::AppendSchematic(), and NETLIST_EXPORTER_GENERIC::makeLibraries().

279 {
280  const LIB_TABLE_ROW* row = findRow( aNickname );
281 
282  wxString retv;
283 
284  if( row )
285  retv = row->GetFullURI( aExpandEnvVars );
286 
287  return retv;
288 }
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE...
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment...
wxString SYMBOL_LIB_TABLE::GetGlobalTableFileName ( )
static

Fetch the global symbol library table file name.

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

Definition at line 509 of file symbol_lib_table.cpp.

References GetKicadConfigPath(), and global_tbl_name().

Referenced by DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG(), DIALOG_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), LoadGlobalTable(), SCH::IFACE::OnKifaceStart(), SCH_BASE_FRAME::saveSymbolLibTables(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().

510 {
511  wxFileName fn;
512 
513  fn.SetPath( GetKicadConfigPath() );
514  fn.SetName( global_tbl_name );
515 
516  return fn.GetFullPath();
517 }
static const wxString global_tbl_name("sym-lib-table")
wxString GetKicadConfigPath()
Return the user configuration path used to store KiCad&#39;s configuration files.
Definition: common.cpp:211
std::vector< wxString > LIB_TABLE::GetLogicalLibs ( )
inherited

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

Definition at line 371 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(), FP_LIB_TABLE::GenerateTimestamp(), GetModifyHash(), guessNickname(), CVPCB_MAINFRAME::LoadFootprintFiles(), LoadSymbolWithOptionalNickname(), FOOTPRINT_VIEWER_FRAME::OnActivate(), LIB_VIEW_FRAME::OnSelectSymbol(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), SCH_BASE_FRAME::SelectComponentFromLibrary(), PCB_BASE_FRAME::SelectLibrary(), and FOOTPRINT_LIST_IMPL::StartWorkers().

372 {
373  // Only return unique logical library names. Use std::set::insert() to
374  // quietly reject any duplicates, which can happen when encountering a duplicate
375  // nickname from one of the fall back table(s).
376 
377  std::set< wxString > unique;
378  std::vector< wxString > ret;
379  const LIB_TABLE* cur = this;
380 
381  do
382  {
383  for( LIB_TABLE_ROWS_CITER it = cur->rows.begin(); it!=cur->rows.end(); ++it )
384  {
385  if( it->GetIsEnabled() )
386  {
387  unique.insert( it->GetNickName() );
388  }
389  }
390 
391  } while( ( cur = cur->fallBack ) != 0 );
392 
393  ret.reserve( unique.size() );
394 
395  // return a sorted, unique set of nicknames in a std::vector<wxString> to caller
396  for( std::set< wxString >::const_iterator it = unique.begin(); it!=unique.end(); ++it )
397  {
398  ret.push_back( *it );
399  }
400 
401  return ret;
402 }
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
LIB_TABLE_ROWS::const_iterator LIB_TABLE_ROWS_CITER
Manage LIB_TABLE_ROW records (rows), and can be searched based on library nickname.
int SYMBOL_LIB_TABLE::GetModifyHash ( )

Definition at line 238 of file symbol_lib_table.cpp.

References FindRow(), LIB_TABLE::GetLogicalLibs(), SCH_PLUGIN::GetModifyHash(), m_modifyHash, and SYMBOL_LIB_TABLE_ROW::plugin.

Referenced by LIB_MANAGER::GetHash(), LIB_MANAGER::Sync(), and SCH_SCREEN::UpdateSymbolLinks().

239 {
240  int hash = 0;
241  std::vector< wxString > libNames = GetLogicalLibs();
242 
243  for( const auto& libName : libNames )
244  {
245  const SYMBOL_LIB_TABLE_ROW* row = FindRow( libName );
246 
247  if( !row || !row->plugin )
248  {
249  wxFAIL;
250  continue;
251  }
252 
253  hash += row->plugin->GetModifyHash();
254  }
255 
256  hash += m_modifyHash;
257 
258  return hash;
259 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
virtual int GetModifyHash() const =0
Return the modification hash from the library cache.
static int m_modifyHash
helper for GetModifyHash()
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE...
size_t SYMBOL_LIB_TABLE::GetSymbolCount ( const wxString &  aNickname)

Return the number of symbols in the symbol library mapped to aNickname.

Definition at line 262 of file symbol_lib_table.cpp.

References LIB_TABLE::findRow(), LIB_TABLE_ROW::GetFullURI(), SCH_PLUGIN::GetSymbolLibCount(), and SYMBOL_LIB_TABLE_ROW::plugin.

263 {
264  SYMBOL_LIB_TABLE_ROW* row = dynamic_cast< SYMBOL_LIB_TABLE_ROW* >( findRow( aNickname ) );
265  wxCHECK( row && row->plugin, 0 );
266 
267  return row->plugin->GetSymbolLibCount( row->GetFullURI( true ) );
268 }
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
virtual size_t GetSymbolLibCount(const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Definition: sch_plugin.cpp:66
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment...
const wxString SYMBOL_LIB_TABLE::GlobalPathEnvVariableName ( )
static

Return the name of the environment variable used to hold the directory of locally installed "KiCad sponsored" system symbol libraries.

These can be either legacy or sweet 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 469 of file symbol_lib_table.cpp.

Referenced by DIALOG_SYMBOL_LIB_TABLE::populateEnvironReadOnlyTable().

470 {
471  return "KICAD_SYMBOL_DIR";
472 }
bool LIB_TABLE::HasLibrary ( const wxString &  aNickname,
bool  aCheckEnabled = false 
) const
inherited

Test for the existence of aNickname in the library table.

Parameters
aCheckEnabledif true will only return true for enabled libraries
Returns
true if a library aNickname exists in the table.

Definition at line 264 of file lib_table_base.cpp.

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

Referenced by SCH_EDIT_FRAME::AppendSchematic(), LIB_MANAGER::LibraryExists(), SCH_EAGLE_PLUGIN::Load(), NETLIST_EXPORTER_GENERIC::makeLibraries(), SCH_COMPONENT::Resolve(), SCH_BASE_FRAME::SelectComponentFromLibrary(), and SCH_COMPONENT::SetLibId().

265 {
266  const LIB_TABLE_ROW* row = findRow( aNickname );
267 
268  if( row == nullptr )
269  return false;
270 
271  if( aCheckEnabled && !row->GetIsEnabled() )
272  return false;
273 
274  return true;
275 }
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE...
LIB_TABLE_ROW * findRow(const wxString &aNickname) const
Return a LIB_TABLE_ROW if aNickname is found in this table or in any chained fallBack table fragment...
bool GetIsEnabled() const
bool LIB_TABLE::InsertRow ( LIB_TABLE_ROW aRow,
bool  doReplace = false 
)
inherited

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 405 of file lib_table_base.cpp.

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

Referenced by LIB_MANAGER::addLibrary(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), PCB_EDIT_FRAME::importFile(), SCH_EAGLE_PLUGIN::Load(), FP_LIB_TABLE::Parse(), and Parse().

406 {
407  ensureIndex();
408 
409  INDEX_CITER it = nickIndex.find( aRow->GetNickName() );
410 
411  if( it == nickIndex.end() )
412  {
413  rows.push_back( aRow );
414  nickIndex.insert( INDEX_VALUE( aRow->GetNickName(), rows.size() - 1 ) );
415  return true;
416  }
417 
418  if( doReplace )
419  {
420  rows.replace( it->second, aRow );
421  return true;
422  }
423 
424  return false;
425 }
void ensureIndex()
INDEX::const_iterator INDEX_CITER
LIB_TABLE_ROWS rows
INDEX::value_type INDEX_VALUE
const wxString & GetNickName() const
INDEX nickIndex
this particular key is the nickName within each row.
bool LIB_TABLE::IsEmpty ( bool  aIncludeFallback = true)
inherited

Return true if the table is empty.

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 243 of file lib_table_base.cpp.

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

Referenced by SCH_EDIT_FRAME::AppendSchematic(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), LIB_TABLE::IsEmpty(), PCB_EDIT_FRAME::LoadFootprints(), and FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib().

244 {
245  if( !aIncludeFallback || !fallBack )
246  return rows.empty();
247 
248  return rows.empty() && fallBack->IsEmpty( true );
249 }
LIB_TABLE_ROWS rows
LIB_TABLE * fallBack
bool IsEmpty(bool aIncludeFallback=true)
Return true if the table is empty.
bool SYMBOL_LIB_TABLE::IsSymbolLibWritable ( const wxString &  aNickname)

Return true if the library given by aNickname is writable.

It is possible that some symbols libraries are read only because of where they are installed.

Parameters
aNicknameis the library nickname in the symbol library table.
Exceptions
IO_ERRORif no library at aNickname exists.

Definition at line 414 of file symbol_lib_table.cpp.

References FindRow(), LIB_TABLE_ROW::GetFullURI(), SCH_PLUGIN::IsSymbolLibWritable(), and SYMBOL_LIB_TABLE_ROW::plugin.

415 {
416  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
417  wxCHECK( row && row->plugin, false );
418  return row->plugin->IsSymbolLibWritable( row->GetFullURI( true ) );
419 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
virtual bool IsSymbolLibWritable(const wxString &aLibraryPath)
Return true if the library at aLibraryPath is writable.
Definition: sch_plugin.cpp:141
void LIB_TABLE::Load ( const wxString &  aFileName)
inherited

Load 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 428 of file lib_table_base.cpp.

References LIB_TABLE::Parse().

Referenced by PROJECT::AbsolutePath(), SCH_EDIT_FRAME::AppendSchematic(), FP_LIB_TABLE::LoadGlobalTable(), LoadGlobalTable(), LIB_EDIT_FRAME::OnPreferencesOptions(), PROJECT::PcbFootprintLibs(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().

430 {
431  // It's OK if footprint library tables are missing.
432  if( wxFileName::IsFileReadable( aFileName ) )
433  {
434  FILE_LINE_READER reader( aFileName );
435  LIB_TABLE_LEXER lexer( &reader );
436 
437  Parse( &lexer );
438  }
439 }
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
Parse the #LIB_TABLE_LEXER s-expression library table format into the appropriate LIB_TABLE_ROW objec...
bool SYMBOL_LIB_TABLE::LoadGlobalTable ( SYMBOL_LIB_TABLE aTable)
static

Load the global symbol 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 SYMBOL_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 symbol library table.

Definition at line 475 of file symbol_lib_table.cpp.

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

Referenced by SCH::IFACE::OnKifaceStart(), and DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow().

476 {
477  bool tableExists = true;
478  wxFileName fn = GetGlobalTableFileName();
479 
480  if( !fn.FileExists() )
481  {
482  tableExists = false;
483 
484  if( !fn.DirExists() && !fn.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
485  {
486  THROW_IO_ERROR( wxString::Format( _( "Cannot create global library table path \"%s\"." ),
487  GetChars( fn.GetPath() ) ) );
488  }
489 
490  // Attempt to copy the default global file table from the KiCad
491  // template folder to the user's home configuration path.
492  wxString fileName = Kiface().KifaceSearch().FindValidPath( global_tbl_name );
493 
494  // The fallback is to create an empty global symbol table for the user to populate.
495  if( fileName.IsEmpty() || !::wxCopyFile( fileName, fn.GetFullPath(), false ) )
496  {
497  SYMBOL_LIB_TABLE emptyTable;
498 
499  emptyTable.Save( fn.GetFullPath() );
500  }
501  }
502 
503  aTable.Load( fn.GetFullPath() );
504 
505  return tableExists;
506 }
static const wxString global_tbl_name("sym-lib-table")
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
SEARCH_STACK & KifaceSearch()
Only for DSO specific &#39;non-library&#39; files.
Definition: kiface_i.h:127
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
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()
Fetch the global symbol library table file name.
LIB_ALIAS * SYMBOL_LIB_TABLE::LoadSymbol ( const wxString &  aNickname,
const wxString &  aAliasName 
)

Load a LIB_ALIAS having aAliasName from the library given by aNickname.

The actual symbol can be retreaved from the LIB_ALIAS::GetPart() method.

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW
aAliasNameis the name of the LIB_ALIAS to load.
Returns
the symbol alias if found or NULL if not found.
Exceptions
IO_ERRORif the library cannot be found or read. No exception is thrown in the case where aAliasName cannot be found.

Definition at line 344 of file symbol_lib_table.cpp.

References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_PART::GetLibId(), LIB_TABLE_ROW::GetNickName(), LIB_ALIAS::GetPart(), LIB_TABLE_ROW::GetProperties(), SCH_PLUGIN::LoadSymbol(), SYMBOL_LIB_TABLE_ROW::plugin, and LIB_ID::SetLibNickname().

Referenced by CMP_TREE_MODEL_ADAPTER::AddAliasList(), AddMenusForEditComponent(), DisplayCmpDocAndKeywords(), ALIAS_INFO_GENERATOR::GenerateHtml(), LIB_MANAGER::GetAlias(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getOriginalParts(), LoadSymbolWithOptionalNickname(), LIB_MANAGER::PartExists(), SCH_COMPONENT::Resolve(), SchGetLibAlias(), and SCH_COMPONENT::SetLibId().

345 {
346  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
347  wxCHECK( row && row->plugin, nullptr );
348 
349  LIB_ALIAS* ret = row->plugin->LoadSymbol( row->GetFullURI( true ), aAliasName,
350  row->GetProperties() );
351 
352  // The library cannot know its own name, because it might have been renamed or moved.
353  // Therefore footprints cannot know their own library nickname when residing in
354  // a symbol library.
355  // Only at this API layer can we tell the symbol about its actual library nickname.
356  if( ret )
357  {
358  // remove "const"-ness, I really do want to set nickname without
359  // having to copy the LIB_ID and its two strings, twice each.
360  LIB_ID& id = (LIB_ID&) ret->GetPart()->GetLibId();
361 
362  id.SetLibNickname( row->GetNickName() );
363  }
364 
365  return ret;
366 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Part library alias object definition.
virtual LIB_ALIAS * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const PROPERTIES *aProperties=NULL)
Load a LIB_ALIAS object having aAliasName from the aLibraryPath containing a library format that this...
Definition: sch_plugin.cpp:93
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const LIB_ID & GetLibId() const
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
LIB_PART * GetPart() const
Get the shared LIB_PART.
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:219
const wxString & GetNickName() const
LIB_ALIAS* SYMBOL_LIB_TABLE::LoadSymbol ( const LIB_ID aLibId)
inline

Definition at line 181 of file symbol_lib_table.h.

References LIB_ID::GetLibItemName(), and LIB_ID::GetLibNickname().

182  {
183  return LoadSymbol( aLibId.GetLibNickname(), aLibId.GetLibItemName() );
184  }
LIB_ALIAS * LoadSymbol(const wxString &aNickname, const wxString &aAliasName)
Load a LIB_ALIAS having aAliasName from the library given by aNickname.
const UTF8 & GetLibItemName() const
Definition: lib_id.h:118
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:101
void SYMBOL_LIB_TABLE::LoadSymbolLib ( std::vector< LIB_ALIAS * > &  aAliasList,
const wxString &  aNickname,
bool  aPowerSymbolsOnly = false 
)

Definition at line 313 of file symbol_lib_table.cpp.

References SCH_PLUGIN::EnumerateSymbolLib(), FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_TABLE_ROW::GetNickName(), LIB_TABLE_ROW::GetOptions(), LIB_TABLE_ROW::GetProperties(), SYMBOL_LIB_TABLE_ROW::plugin, PropPowerSymsOnly, LIB_ID::SetLibNickname(), and LIB_TABLE_ROW::SetOptions().

Referenced by CMP_TREE_MODEL_ADAPTER::AddLibrary(), and LIB_MANAGER::GetAliases().

315 {
316  SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
317  wxCHECK( row && row->plugin, /* void */ );
318 
319  wxString options = row->GetOptions();
320 
321  if( aPowerSymbolsOnly )
322  row->SetOptions( row->GetOptions() + " " + PropPowerSymsOnly );
323 
324  row->plugin->EnumerateSymbolLib( aAliasList, row->GetFullURI( true ), row->GetProperties() );
325 
326  if( aPowerSymbolsOnly )
327  row->SetOptions( options );
328 
329  // The library cannot know its own name, because it might have been renamed or moved.
330  // Therefore footprints cannot know their own library nickname when residing in
331  // a symbol library.
332  // Only at this API layer can we tell the symbol about its actual library nickname.
333  for( LIB_ALIAS* alias : aAliasList )
334  {
335  // remove "const"-ness, I really do want to set nickname without
336  // having to copy the LIB_ID and its two strings, twice each.
337  LIB_ID& id = (LIB_ID&) alias->GetPart()->GetLibId();
338 
339  id.SetLibNickname( row->GetNickName() );
340  }
341 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Part library alias object definition.
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
virtual void EnumerateSymbolLib(wxArrayString &aAliasNameList, const wxString &aLibraryPath, const PROPERTIES *aProperties=NULL)
Populate a list of LIB_PART alias names contained within the library aLibraryPath.
Definition: sch_plugin.cpp:75
const wxString & GetOptions() const
Return the options string, which may hold a password or anything else needed to instantiate the under...
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:219
const wxString & GetNickName() const
void SetOptions(const wxString &aOptions)
Change the library options strings.
static const char * PropPowerSymsOnly
LIB_ALIAS * SYMBOL_LIB_TABLE::LoadSymbolWithOptionalNickname ( const LIB_ID aId)

Load a LIB_PART having aFootprintId with possibly an empty library nickname.

Parameters
aIdthe library nickname and name of the symbol to load.
Returns
the library symbol if found (the library owns it) or NULL if not found.
Exceptions
IO_ERRORif the library cannot be found or read. No exception is thrown in the case where aId cannot be found.
PARSE_ERRORif aId is not parsed OK.

Definition at line 438 of file symbol_lib_table.cpp.

References LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), LIB_TABLE::GetLogicalLibs(), i, LoadSymbol(), and name.

439 {
440  wxString nickname = aLibId.GetLibNickname();
441  wxString name = aLibId.GetLibItemName();
442 
443  if( nickname.size() )
444  {
445  return LoadSymbol( nickname, name );
446  }
447 
448  // nickname is empty, sequentially search (alphabetically) all libs/nicks for first match:
449  else
450  {
451  std::vector<wxString> nicks = GetLogicalLibs();
452 
453  // Search each library going through libraries alphabetically.
454  for( unsigned i = 0; i < nicks.size(); ++i )
455  {
456  // FootprintLoad() returns NULL on not found, does not throw exception
457  // unless there's an IO_ERROR.
458  LIB_ALIAS* ret = LoadSymbol( nicks[i], name );
459 
460  if( ret )
461  return ret;
462  }
463 
464  return NULL;
465  }
466 }
LIB_ALIAS * LoadSymbol(const wxString &aNickname, const wxString &aAliasName)
Load a LIB_ALIAS having aAliasName from the library given by aNickname.
Part library alias object definition.
const char * name
Definition: DXF_plotter.cpp:61
size_t i
Definition: json11.cpp:597
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE...
bool LIB_TABLE::operator!= ( const LIB_TABLE r) const
inlineinherited

Definition at line 334 of file lib_table_base.h.

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

Definition at line 318 of file lib_table_base.h.

References i, and LIB_TABLE::rows.

319  {
320  if( rows.size() == r.rows.size() )
321  {
322  unsigned i;
323 
324  for( i = 0; i < rows.size() && rows[i] == r.rows[i]; ++i )
325  ;
326 
327  if( i == rows.size() )
328  return true;
329  }
330 
331  return false;
332  }
LIB_TABLE_ROWS rows
size_t i
Definition: json11.cpp:597
void SYMBOL_LIB_TABLE::Parse ( LIB_TABLE_LEXER *  aLexer)
overridevirtual

Parse 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 83 of file symbol_lib_table.cpp.

References Format(), GetChars(), LIB_TABLE::InsertRow(), and THROW_IO_ERROR.

Referenced by SYMBOL_GRID_TRICKS::paste_text().

84 {
85  T tok;
86  wxString errMsg; // to collect error messages
87 
88  // This table may be nested within a larger s-expression, or not.
89  // Allow for parser of that optional containing s-epression to have looked ahead.
90  if( in->CurTok() != T_sym_lib_table )
91  {
92  in->NeedLEFT();
93  if( ( tok = in->NextTok() ) != T_sym_lib_table )
94  in->Expecting( T_sym_lib_table );
95  }
96 
97  while( ( tok = in->NextTok() ) != T_RIGHT )
98  {
99  std::unique_ptr< SYMBOL_LIB_TABLE_ROW > row( new SYMBOL_LIB_TABLE_ROW );
100 
101  if( tok == T_EOF )
102  in->Expecting( T_RIGHT );
103 
104  if( tok != T_LEFT )
105  in->Expecting( T_LEFT );
106 
107  // in case there is a "row integrity" error, tell where later.
108  int lineNum = in->CurLineNumber();
109 
110  if( ( tok = in->NextTok() ) != T_lib )
111  in->Expecting( T_lib );
112 
113  // (name NICKNAME)
114  in->NeedLEFT();
115 
116  if( ( tok = in->NextTok() ) != T_name )
117  in->Expecting( T_name );
118 
119  in->NeedSYMBOLorNUMBER();
120 
121  row->SetNickName( in->FromUTF8() );
122 
123  in->NeedRIGHT();
124 
125  // After (name), remaining (lib) elements are order independent, and in
126  // some cases optional.
127  bool sawType = false;
128  bool sawOpts = false;
129  bool sawDesc = false;
130  bool sawUri = false;
131  bool sawDisabled = false;
132 
133  while( ( tok = in->NextTok() ) != T_RIGHT )
134  {
135  if( tok == T_EOF )
136  in->Unexpected( T_EOF );
137 
138  if( tok != T_LEFT )
139  in->Expecting( T_LEFT );
140 
141  tok = in->NeedSYMBOLorNUMBER();
142 
143  switch( tok )
144  {
145  case T_uri:
146  if( sawUri )
147  in->Duplicate( tok );
148  sawUri = true;
149  in->NeedSYMBOLorNUMBER();
150  row->SetFullURI( in->FromUTF8() );
151  break;
152 
153  case T_type:
154  if( sawType )
155  in->Duplicate( tok );
156  sawType = true;
157  in->NeedSYMBOLorNUMBER();
158  row->SetType( in->FromUTF8() );
159  break;
160 
161  case T_options:
162  if( sawOpts )
163  in->Duplicate( tok );
164  sawOpts = true;
165  in->NeedSYMBOLorNUMBER();
166  row->SetOptions( in->FromUTF8() );
167  break;
168 
169  case T_descr:
170  if( sawDesc )
171  in->Duplicate( tok );
172  sawDesc = true;
173  in->NeedSYMBOLorNUMBER();
174  row->SetDescr( in->FromUTF8() );
175  break;
176 
177  case T_disabled:
178  if( sawDisabled )
179  in->Duplicate( tok );
180  sawDisabled = true;
181  row->SetEnabled( false );
182  break;
183 
184  default:
185  in->Unexpected( tok );
186  }
187 
188  in->NeedRIGHT();
189  }
190 
191  if( !sawType )
192  in->Expecting( T_type );
193 
194  if( !sawUri )
195  in->Expecting( T_uri );
196 
197  // all nickNames within this table fragment must be unique, so we do not
198  // use doReplace in InsertRow(). (However a fallBack table can have a
199  // conflicting nickName and ours will supercede that one since in
200  // FindLib() we search this table before any fall back.)
201  wxString nickname = row->GetNickName(); // store it to be able to used it
202  // after row deletion if an error occurs
203  LIB_TABLE_ROW* tmp = row.release();
204 
205  if( !InsertRow( tmp ) )
206  {
207  delete tmp; // The table did not take ownership of the row.
208 
209  wxString msg = wxString::Format(
210  _( "Duplicate library nickname \"%s\" found in symbol library "
211  "table file line %d" ), GetChars( nickname ), lineNum );
212 
213  if( !errMsg.IsEmpty() )
214  errMsg << '\n';
215 
216  errMsg << msg;
217  }
218  }
219 
220  if( !errMsg.IsEmpty() )
221  THROW_IO_ERROR( errMsg );
222 }
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE...
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Adds aRow if it does not already exist or if doReplace is true.
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

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

450 {
451  if( aOptionsList.size() )
452  {
453  const char* cp = &aOptionsList[0];
454  const char* end = cp + aOptionsList.size();
455 
456  PROPERTIES props;
457  std::string pair;
458 
459  // Parse all name=value pairs
460  while( cp < end )
461  {
462  pair.clear();
463 
464  // Skip leading white space.
465  while( cp < end && isspace( *cp ) )
466  ++cp;
467 
468  // Find the end of pair/field
469  while( cp < end )
470  {
471  if( *cp == '\\' && cp + 1 < end && cp[1] == OPT_SEP )
472  {
473  ++cp; // skip the escape
474  pair += *cp++; // add the separator
475  }
476  else if( *cp == OPT_SEP )
477  {
478  ++cp; // skip the separator
479  break; // process the pair
480  }
481  else
482  pair += *cp++;
483  }
484 
485  // stash the pair
486  if( pair.size() )
487  {
488  // first equals sign separates 'name' and 'value'.
489  size_t eqNdx = pair.find( '=' );
490 
491  if( eqNdx != pair.npos )
492  {
493  std::string name = pair.substr( 0, eqNdx );
494  std::string value = pair.substr( eqNdx + 1 );
495  props[name] = value;
496  }
497  else
498  props[pair] = ""; // property is present, but with no value.
499  }
500  }
501 
502  if( props.size() )
503  return new PROPERTIES( props );
504  }
505 
506  return NULL;
507 }
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
Definition: DXF_plotter.cpp:61
#define OPT_SEP
options separator character
void LIB_TABLE::reindex ( )
inlineprotectedinherited

Definition at line 457 of file lib_table_base.h.

Referenced by DIALOG_SYMBOL_LIB_TABLE::TransferDataFromWindow().

458  {
459  nickIndex.clear();
460 
461  for( LIB_TABLE_ROWS_ITER it = rows.begin(); it != rows.end(); ++it )
462  nickIndex.insert( INDEX_VALUE( it->GetNickName(), it - rows.begin() ) );
463  }
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

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

Parameters
aFileNameis the name of the file to write to.

Definition at line 442 of file lib_table_base.cpp.

References LIB_TABLE::Format().

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

443 {
444  FILE_OUTPUTFORMATTER sf( aFileName );
445  Format( &sf, 0 );
446 }
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
SYMBOL_LIB_TABLE::SAVE_T SYMBOL_LIB_TABLE::SaveSymbol ( const wxString &  aNickname,
const LIB_PART aSymbol,
bool  aOverwrite = true 
)

Write aSymbol to an existing library given by aNickname.

If a LIB_PART by the same name already exists or there are any conflicting alias names, the new LIB_PART will silently overwrite any existing aliases and/or part becaue libraries cannot have duplicate alias names. It is the responsibility of the caller to check the library for conflicts before saving.

Parameters
aNicknameis a locator for the "library", it is a "name" in LIB_TABLE_ROW
aSymbolis what to store in the library. The library owns the symbol after this call.
aOverwritewhen true means overwrite any existing symbol 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 the symbol.

Definition at line 369 of file symbol_lib_table.cpp.

References FindRow(), LIB_TABLE_ROW::GetFullURI(), LIB_PART::GetLibId(), LIB_ID::GetLibItemName(), LIB_TABLE_ROW::GetProperties(), SCH_PLUGIN::LoadSymbol(), name, SYMBOL_LIB_TABLE_ROW::plugin, SAVE_OK, SAVE_SKIPPED, and SCH_PLUGIN::SaveSymbol().

Referenced by LIB_MANAGER::LIB_BUFFER::SaveBuffer().

371 {
372  const SYMBOL_LIB_TABLE_ROW* row = FindRow( aNickname );
373  wxCHECK( row && row->plugin, SAVE_SKIPPED );
374 
375  if( !aOverwrite )
376  {
377  // Try loading the footprint to see if it already exists, caller wants overwrite
378  // protection, which is atypical, not the default.
379 
380  wxString name = aSymbol->GetLibId().GetLibItemName();
381 
382  std::unique_ptr< LIB_ALIAS > symbol( row->plugin->LoadSymbol( row->GetFullURI( true ),
383  name,
384  row->GetProperties() ) );
385 
386  if( symbol.get() )
387  return SAVE_SKIPPED;
388  }
389 
390  row->plugin->SaveSymbol( row->GetFullURI( true ), aSymbol, row->GetProperties() );
391 
392  return SAVE_OK;
393 }
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
virtual LIB_ALIAS * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const PROPERTIES *aProperties=NULL)
Load a LIB_ALIAS object having aAliasName from the aLibraryPath containing a library format that this...
Definition: sch_plugin.cpp:93
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
const PROPERTIES * GetProperties() const
Return the constant PROPERTIES for this library (LIB_TABLE_ROW).
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin
const LIB_ID & GetLibId() const
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
const UTF8 & GetLibItemName() const
Definition: lib_id.h:118
const char * name
Definition: DXF_plotter.cpp:61
virtual void SaveSymbol(const wxString &aLibraryPath, const LIB_PART *aSymbol, const PROPERTIES *aProperties=NULL)
Write aSymbol to an existing library located at aLibraryPath.
Definition: sch_plugin.cpp:102

Friends And Related Function Documentation

friend class DIALOG_SYMBOL_LIB_TABLE
friend

Definition at line 105 of file symbol_lib_table.h.

friend class SYMBOL_LIB_TABLE_GRID
friend

Definition at line 104 of file symbol_lib_table.h.

Member Data Documentation

LIB_TABLE* LIB_TABLE::fallBack
protectedinherited
int SYMBOL_LIB_TABLE::m_modifyHash = 1
staticprivate

helper for GetModifyHash()

Definition at line 107 of file symbol_lib_table.h.

Referenced by GetModifyHash().

INDEX LIB_TABLE::nickIndex
protectedinherited

this particular key is the nickName within each row.

Definition at line 483 of file lib_table_base.h.

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

const char * SYMBOL_LIB_TABLE::PropNonPowerSymsOnly = "non_pwr_sym_only"
static

Definition at line 111 of file symbol_lib_table.h.

const char * SYMBOL_LIB_TABLE::PropPowerSymsOnly = "pwr_sym_only"
static

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