KiCad PCB EDA Suite
SCH_SEXPR_PLUGIN_CACHE Class Reference

A cache assistant for the symbol library portion of the SCH_PLUGIN API, and only for the SCH_SEXPR_PLUGIN, so therefore is private to this implementation file, i.e. More...

Public Member Functions

 SCH_SEXPR_PLUGIN_CACHE (const wxString &aLibraryPath)
 
 ~SCH_SEXPR_PLUGIN_CACHE ()
 
int GetModifyHash () const
 
void Save ()
 Save the entire library to file m_libFileName;. More...
 
void Load ()
 
void AddSymbol (const LIB_SYMBOL *aSymbol)
 
void DeleteSymbol (const wxString &aName)
 
wxFileName GetRealFile () const
 
wxDateTime GetLibModificationTime ()
 
bool IsFile (const wxString &aFullPathAndFileName) const
 
bool IsFileChanged () const
 
void SetModified (bool aModified=true)
 
wxString GetLogicalName () const
 
void SetFileName (const wxString &aFileName)
 
wxString GetFileName () const
 

Static Public Member Functions

static void SaveSymbol (LIB_SYMBOL *aSymbol, OUTPUTFORMATTER &aFormatter, int aNestLevel=0, const wxString &aLibName=wxEmptyString)
 

Private Member Functions

LIB_SYMBOLremoveSymbol (LIB_SYMBOL *aAlias)
 

Static Private Member Functions

static void saveSymbolDrawItem (LIB_ITEM *aItem, OUTPUTFORMATTER &aFormatter, int aNestLevel)
 
static void saveField (LIB_FIELD *aField, OUTPUTFORMATTER &aFormatter, int &aNextFreeFieldId, int aNestLevel)
 
static void savePin (LIB_PIN *aPin, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
 
static void saveText (LIB_TEXT *aText, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
 
static void saveDcmInfoAsFields (LIB_SYMBOL *aSymbol, OUTPUTFORMATTER &aFormatter, int &aNextFreeFieldId, int aNestLevel)
 

Private Attributes

wxString m_fileName
 
wxFileName m_libFileName
 
wxDateTime m_fileModTime
 
LIB_SYMBOL_MAP m_symbols
 
bool m_isWritable
 
bool m_isModified
 
int m_versionMajor
 
SCH_LIB_TYPE m_libType
 
friend SCH_SEXPR_PLUGIN
 

Static Private Attributes

static int m_modHash = 1
 

Detailed Description

A cache assistant for the symbol library portion of the SCH_PLUGIN API, and only for the SCH_SEXPR_PLUGIN, so therefore is private to this implementation file, i.e.

not placed into a header.

Definition at line 431 of file sch_sexpr_plugin.cpp.

Constructor & Destructor Documentation

◆ SCH_SEXPR_PLUGIN_CACHE()

SCH_SEXPR_PLUGIN_CACHE::SCH_SEXPR_PLUGIN_CACHE ( const wxString &  aLibraryPath)

Definition at line 1513 of file sch_sexpr_plugin.cpp.

1513  :
1514  m_fileName( aFullPathAndFileName ),
1515  m_libFileName( aFullPathAndFileName ),
1516  m_isWritable( true ),
1517  m_isModified( false )
1518 {
1519  m_versionMajor = -1;
1521 }

References LT_EESCHEMA, m_libType, and m_versionMajor.

◆ ~SCH_SEXPR_PLUGIN_CACHE()

SCH_SEXPR_PLUGIN_CACHE::~SCH_SEXPR_PLUGIN_CACHE ( )

Definition at line 1524 of file sch_sexpr_plugin.cpp.

1525 {
1526  // When the cache is destroyed, all of the alias objects on the heap should be deleted.
1527  for( LIB_SYMBOL_MAP::iterator it = m_symbols.begin(); it != m_symbols.end(); ++it )
1528  delete it->second;
1529 
1530  m_symbols.clear();
1531 }

References m_symbols.

Member Function Documentation

◆ AddSymbol()

void SCH_SEXPR_PLUGIN_CACHE::AddSymbol ( const LIB_SYMBOL aSymbol)

Definition at line 1637 of file sch_sexpr_plugin.cpp.

1638 {
1639  // aSymbol is cloned in SYMBOL_LIB::AddSymbol(). The cache takes ownership of aSymbol.
1640  wxString name = aSymbol->GetName();
1641  LIB_SYMBOL_MAP::iterator it = m_symbols.find( name );
1642 
1643  if( it != m_symbols.end() )
1644  {
1645  removeSymbol( it->second );
1646  }
1647 
1648  m_symbols[ name ] = const_cast< LIB_SYMBOL* >( aSymbol );
1649  m_isModified = true;
1650  ++m_modHash;
1651 }
wxString GetName() const override
Definition: lib_symbol.h:133
LIB_SYMBOL * removeSymbol(LIB_SYMBOL *aAlias)
const char * name
Definition: DXF_plotter.cpp:56

References LIB_SYMBOL::GetName(), m_isModified, m_modHash, m_symbols, name, and removeSymbol().

Referenced by SCH_SEXPR_PLUGIN::SaveSymbol().

◆ DeleteSymbol()

void SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol ( const wxString &  aName)

Definition at line 2073 of file sch_sexpr_plugin.cpp.

2074 {
2075  LIB_SYMBOL_MAP::iterator it = m_symbols.find( aSymbolName );
2076 
2077  if( it == m_symbols.end() )
2078  THROW_IO_ERROR( wxString::Format( _( "library %s does not contain a symbol named %s" ),
2079  m_libFileName.GetFullName(), aSymbolName ) );
2080 
2081  LIB_SYMBOL* symbol = it->second;
2082 
2083  if( symbol->IsRoot() )
2084  {
2085  LIB_SYMBOL* rootSymbol = symbol;
2086 
2087  // Remove the root symbol and all its children.
2088  m_symbols.erase( it );
2089 
2090  LIB_SYMBOL_MAP::iterator it1 = m_symbols.begin();
2091 
2092  while( it1 != m_symbols.end() )
2093  {
2094  if( it1->second->IsAlias()
2095  && it1->second->GetParent().lock() == rootSymbol->SharedPtr() )
2096  {
2097  delete it1->second;
2098  it1 = m_symbols.erase( it1 );
2099  }
2100  else
2101  {
2102  it1++;
2103  }
2104  }
2105 
2106  delete rootSymbol;
2107  }
2108  else
2109  {
2110  // Just remove the alias.
2111  m_symbols.erase( it );
2112  delete symbol;
2113  }
2114 
2115  ++m_modHash;
2116  m_isModified = true;
2117 }
LIB_SYMBOL_SPTR SharedPtr() const
Definition: lib_symbol.h:107
Define a library symbol object.
Definition: lib_symbol.h:96
#define _(s)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:171
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38

References _, Format(), LIB_SYMBOL::IsRoot(), m_isModified, m_libFileName, m_modHash, m_symbols, LIB_SYMBOL::SharedPtr(), and THROW_IO_ERROR.

Referenced by SCH_SEXPR_PLUGIN::DeleteSymbol().

◆ GetFileName()

wxString SCH_SEXPR_PLUGIN_CACHE::GetFileName ( void  ) const
inline

Definition at line 492 of file sch_sexpr_plugin.cpp.

492 { return m_libFileName.GetFullPath(); }

Referenced by SCH_SEXPR_PLUGIN::SaveLibrary().

◆ GetLibModificationTime()

wxDateTime SCH_SEXPR_PLUGIN_CACHE::GetLibModificationTime ( )

Definition at line 1543 of file sch_sexpr_plugin.cpp.

1544 {
1545  wxFileName fn = GetRealFile();
1546 
1547  // update the writable flag while we have a wxFileName, in a network this
1548  // is possibly quite dynamic anyway.
1549  m_isWritable = fn.IsFileWritable();
1550 
1551  return fn.GetModificationTime();
1552 }
wxFileName GetRealFile() const

References GetRealFile(), and m_isWritable.

Referenced by Load().

◆ GetLogicalName()

wxString SCH_SEXPR_PLUGIN_CACHE::GetLogicalName ( ) const
inline

Definition at line 488 of file sch_sexpr_plugin.cpp.

488 { return m_libFileName.GetName(); }

◆ GetModifyHash()

int SCH_SEXPR_PLUGIN_CACHE::GetModifyHash ( ) const
inline

Definition at line 462 of file sch_sexpr_plugin.cpp.

462 { return m_modHash; }

Referenced by SCH_SEXPR_PLUGIN::GetModifyHash().

◆ GetRealFile()

wxFileName SCH_SEXPR_PLUGIN_CACHE::GetRealFile ( ) const

Definition at line 1535 of file sch_sexpr_plugin.cpp.

1536 {
1537  wxFileName fn( m_libFileName );
1539  return fn;
1540 }
static void ResolvePossibleSymlinks(wxFileName &aFilename)
Definition: wx_filename.cpp:85

References m_libFileName, and WX_FILENAME::ResolvePossibleSymlinks().

Referenced by GetLibModificationTime(), IsFileChanged(), and Save().

◆ IsFile()

bool SCH_SEXPR_PLUGIN_CACHE::IsFile ( const wxString &  aFullPathAndFileName) const

Definition at line 1555 of file sch_sexpr_plugin.cpp.

1556 {
1557  return m_fileName == aFullPathAndFileName;
1558 }

References m_fileName.

Referenced by SCH_SEXPR_PLUGIN::cacheLib(), SCH_SEXPR_PLUGIN::DeleteSymbolLib(), and SCH_SEXPR_PLUGIN::SaveLibrary().

◆ IsFileChanged()

bool SCH_SEXPR_PLUGIN_CACHE::IsFileChanged ( ) const

Definition at line 1561 of file sch_sexpr_plugin.cpp.

1562 {
1563  wxFileName fn = GetRealFile();
1564 
1565  if( m_fileModTime.IsValid() && fn.IsOk() && fn.FileExists() )
1566  return fn.GetModificationTime() != m_fileModTime;
1567 
1568  return false;
1569 }
wxFileName GetRealFile() const

References GetRealFile(), and m_fileModTime.

Referenced by SCH_SEXPR_PLUGIN::cacheLib().

◆ Load()

void SCH_SEXPR_PLUGIN_CACHE::Load ( )

Definition at line 1654 of file sch_sexpr_plugin.cpp.

1655 {
1656  if( !m_libFileName.FileExists() )
1657  {
1658  THROW_IO_ERROR( wxString::Format( _( "Library file '%s' not found." ),
1659  m_libFileName.GetFullPath() ) );
1660  }
1661 
1662  wxCHECK_RET( m_libFileName.IsAbsolute(),
1663  wxString::Format( "Cannot use relative file paths in sexpr plugin to "
1664  "open library '%s'.", m_libFileName.GetFullPath() ) );
1665 
1666  // The current locale must use period as the decimal point.
1667  wxCHECK2( wxLocale::GetInfo( wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER ) == ".",
1668  LOCALE_IO toggle );
1669 
1670  wxLogTrace( traceSchLegacyPlugin, "Loading sexpr symbol library file '%s'",
1671  m_libFileName.GetFullPath() );
1672 
1673  FILE_LINE_READER reader( m_libFileName.GetFullPath() );
1674 
1675  SCH_SEXPR_PARSER parser( &reader );
1676 
1677  parser.ParseLib( m_symbols );
1678  ++m_modHash;
1679 
1680  // Remember the file modification time of library file when the
1681  // cache snapshot was made, so that in a networked environment we will
1682  // reload the cache as needed.
1684 }
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
const wxChar *const traceSchLegacyPlugin
Flag to enable legacy schematic plugin debug output.
A LINE_READER that reads from an open file.
Definition: richio.h:172
#define _(s)
Object to parser s-expression symbol library and schematic file formats.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38

References _, Format(), GetLibModificationTime(), m_fileModTime, m_libFileName, m_modHash, m_symbols, THROW_IO_ERROR, and traceSchLegacyPlugin.

Referenced by SCH_SEXPR_PLUGIN::cacheLib(), and SCH_SEXPR_PLUGIN::CreateSymbolLib().

◆ removeSymbol()

LIB_SYMBOL * SCH_SEXPR_PLUGIN_CACHE::removeSymbol ( LIB_SYMBOL aAlias)
private

Definition at line 1572 of file sch_sexpr_plugin.cpp.

1573 {
1574  wxCHECK_MSG( aSymbol != nullptr, nullptr, "NULL pointer cannot be removed from library." );
1575 
1576  LIB_SYMBOL* firstChild = nullptr;
1577  LIB_SYMBOL_MAP::iterator it = m_symbols.find( aSymbol->GetName() );
1578 
1579  if( it == m_symbols.end() )
1580  return nullptr;
1581 
1582  // If the entry pointer doesn't match the name it is mapped to in the library, we
1583  // have done something terribly wrong.
1584  wxCHECK_MSG( *it->second == aSymbol, nullptr,
1585  "Pointer mismatch while attempting to remove alias entry <" + aSymbol->GetName() +
1586  "> from library cache <" + m_libFileName.GetName() + ">." );
1587 
1588  // If the symbol is a root symbol used by other symbols find the first alias that uses
1589  // the root symbol and make it the new root.
1590  if( aSymbol->IsRoot() )
1591  {
1592  for( auto entry : m_symbols )
1593  {
1594  if( entry.second->IsAlias()
1595  && entry.second->GetParent().lock() == aSymbol->SharedPtr() )
1596  {
1597  firstChild = entry.second;
1598  break;
1599  }
1600  }
1601 
1602  if( firstChild )
1603  {
1604  for( LIB_ITEM& drawItem : aSymbol->GetDrawItems() )
1605  {
1606  if( drawItem.Type() == LIB_FIELD_T )
1607  {
1608  LIB_FIELD& field = static_cast<LIB_FIELD&>( drawItem );
1609 
1610  if( firstChild->FindField( field.GetCanonicalName() ) )
1611  continue;
1612  }
1613 
1614  LIB_ITEM* newItem = (LIB_ITEM*) drawItem.Clone();
1615  drawItem.SetParent( firstChild );
1616  firstChild->AddDrawItem( newItem );
1617  }
1618 
1619  // Reparent the remaining aliases.
1620  for( auto entry : m_symbols )
1621  {
1622  if( entry.second->IsAlias()
1623  && entry.second->GetParent().lock() == aSymbol->SharedPtr() )
1624  entry.second->SetParent( firstChild );
1625  }
1626  }
1627  }
1628 
1629  m_symbols.erase( it );
1630  delete aSymbol;
1631  m_isModified = true;
1632  ++m_modHash;
1633  return firstChild;
1634 }
LIB_FIELD * FindField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName and returns it or NULL if not found.
Definition: lib_symbol.cpp:979
Field object used in symbol libraries.
Definition: lib_field.h:59
Define a library symbol object.
Definition: lib_symbol.h:96
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:115
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:83
The base class for drawable items used by schematic library symbols.
Definition: lib_item.h:61
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
Definition: lib_field.cpp:371
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Definition: lib_symbol.cpp:665

References LIB_SYMBOL::AddDrawItem(), EDA_ITEM::Clone(), LIB_SYMBOL::FindField(), LIB_FIELD::GetCanonicalName(), LIB_SYMBOL::GetDrawItems(), LIB_SYMBOL::GetName(), LIB_SYMBOL::IsRoot(), LIB_FIELD_T, m_isModified, m_libFileName, m_modHash, m_symbols, EDA_ITEM::SetParent(), and LIB_SYMBOL::SharedPtr().

Referenced by AddSymbol().

◆ Save()

void SCH_SEXPR_PLUGIN_CACHE::Save ( )

Save the entire library to file m_libFileName;.

Definition at line 1687 of file sch_sexpr_plugin.cpp.

1688 {
1689  if( !m_isModified )
1690  return;
1691 
1692  LOCALE_IO toggle; // toggles on, then off, the C locale.
1693 
1694  // Write through symlinks, don't replace them.
1695  wxFileName fn = GetRealFile();
1696 
1697  auto formatter = std::make_unique<FILE_OUTPUTFORMATTER>( fn.GetFullPath() );
1698 
1699  formatter->Print( 0, "(kicad_symbol_lib (version %d) (generator kicad_symbol_editor)\n",
1701 
1702  for( auto parent : m_symbols )
1703  {
1704  // Save the root symbol first so alias can inherit from them.
1705  if( parent.second->IsRoot() )
1706  {
1707  SaveSymbol( parent.second, *formatter.get(), 1 );
1708 
1709  // Save all of the aliases associated with the current root symbol.
1710  for( auto alias : m_symbols )
1711  {
1712  if( !alias.second->IsAlias() )
1713  continue;
1714 
1715  std::shared_ptr<LIB_SYMBOL> aliasParent = alias.second->GetParent().lock();
1716 
1717  if( aliasParent.get() != parent.second )
1718  continue;
1719 
1720  SaveSymbol( alias.second, *formatter.get(), 1 );
1721  }
1722  }
1723  }
1724 
1725  formatter->Print( 0, ")\n" );
1726 
1727  formatter.reset();
1728 
1729  m_fileModTime = fn.GetModificationTime();
1730  m_isModified = false;
1731 }
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
#define SEXPR_SYMBOL_LIB_FILE_VERSION
This file contains the file format version information for the s-expression schematic and symbol libr...
wxFileName GetRealFile() const
static void SaveSymbol(LIB_SYMBOL *aSymbol, OUTPUTFORMATTER &aFormatter, int aNestLevel=0, const wxString &aLibName=wxEmptyString)

References GetRealFile(), m_fileModTime, m_isModified, m_symbols, SaveSymbol(), and SEXPR_SYMBOL_LIB_FILE_VERSION.

Referenced by SCH_SEXPR_PLUGIN::CreateSymbolLib(), SCH_SEXPR_PLUGIN::DeleteSymbol(), SCH_SEXPR_PLUGIN::SaveLibrary(), and SCH_SEXPR_PLUGIN::SaveSymbol().

◆ saveDcmInfoAsFields()

void SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields ( LIB_SYMBOL aSymbol,
OUTPUTFORMATTER aFormatter,
int &  aNextFreeFieldId,
int  aNestLevel 
)
staticprivate

Definition at line 1873 of file sch_sexpr_plugin.cpp.

1875 {
1876  wxCHECK_RET( aSymbol, "Invalid LIB_SYMBOL pointer." );
1877 
1878  if( !aSymbol->GetKeyWords().IsEmpty() )
1879  {
1880  LIB_FIELD keywords( -1, wxString( "ki_keywords" ) );
1881  keywords.SetVisible( false );
1882  keywords.SetText( aSymbol->GetKeyWords() );
1883  saveField( &keywords, aFormatter, aNextFreeFieldId, aNestLevel + 1 );
1884  }
1885 
1886  if( !aSymbol->GetDescription().IsEmpty() )
1887  {
1888  LIB_FIELD description( -1, wxString( "ki_description" ) );
1889  description.SetVisible( false );
1890  description.SetText( aSymbol->GetDescription() );
1891  saveField( &description, aFormatter, aNextFreeFieldId, aNestLevel + 1 );
1892  }
1893 
1894  wxArrayString fpFilters = aSymbol->GetFPFilters();
1895 
1896  if( !fpFilters.IsEmpty() )
1897  {
1898  wxString tmp;
1899 
1900  for( auto filter : fpFilters )
1901  {
1902  // Spaces are not handled in fp filter names so escape spaces if any
1903  wxString curr_filter = EscapeString( filter, ESCAPE_CONTEXT::CTX_NO_SPACE );
1904 
1905  if( tmp.IsEmpty() )
1906  tmp = curr_filter;
1907  else
1908  tmp += " " + curr_filter;
1909  }
1910 
1911  LIB_FIELD description( -1, wxString( "ki_fp_filters" ) );
1912  description.SetVisible( false );
1913  description.SetText( tmp );
1914  saveField( &description, aFormatter, aNextFreeFieldId, aNestLevel + 1 );
1915  }
1916 }
static void saveField(LIB_FIELD *aField, OUTPUTFORMATTER &aFormatter, int &aNextFreeFieldId, int aNestLevel)
Field object used in symbol libraries.
Definition: lib_field.h:59
wxString GetKeyWords() const
Definition: lib_symbol.h:155
wxArrayString GetFPFilters() const
Definition: lib_symbol.h:183
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
wxString GetDescription() override
Definition: lib_symbol.h:142

References CTX_NO_SPACE, EscapeString(), filter, LIB_SYMBOL::GetDescription(), LIB_SYMBOL::GetFPFilters(), LIB_SYMBOL::GetKeyWords(), saveField(), EDA_TEXT::SetText(), and EDA_TEXT::SetVisible().

Referenced by SaveSymbol().

◆ saveField()

void SCH_SEXPR_PLUGIN_CACHE::saveField ( LIB_FIELD aField,
OUTPUTFORMATTER aFormatter,
int &  aNextFreeFieldId,
int  aNestLevel 
)
staticprivate

Definition at line 1982 of file sch_sexpr_plugin.cpp.

1984 {
1985  wxCHECK_RET( aField && aField->Type() == LIB_FIELD_T, "Invalid LIB_FIELD object." );
1986 
1987  wxString fieldName = aField->GetName();
1988 
1989  if( aField->GetId() == -1 /* undefined ID */ )
1990  {
1991  aField->SetId( aNextFreeFieldId );
1992  aNextFreeFieldId += 1;
1993  }
1994  else if( aField->GetId() >= aNextFreeFieldId )
1995  {
1996  aNextFreeFieldId = aField->GetId() + 1;
1997  }
1998 
1999  if( aField->GetId() >= 0 && aField->GetId() < MANDATORY_FIELDS )
2000  fieldName = TEMPLATE_FIELDNAME::GetDefaultFieldName( aField->GetId(), false );
2001 
2002  aFormatter.Print( aNestLevel, "(property %s %s (id %d) (at %s %s %g)\n",
2003  aFormatter.Quotew( fieldName ).c_str(),
2004  aFormatter.Quotew( aField->GetText() ).c_str(),
2005  aField->GetId(),
2006  FormatInternalUnits( aField->GetPosition().x ).c_str(),
2007  FormatInternalUnits( aField->GetPosition().y ).c_str(),
2008  static_cast<double>( aField->GetTextAngle() ) / 10.0 );
2009 
2010  aField->Format( &aFormatter, aNestLevel, 0 );
2011  aFormatter.Print( aNestLevel, ")\n" );
2012 }
wxPoint GetPosition() const override
Definition: lib_field.h:157
double GetTextAngle() const
Definition: eda_text.h:195
int GetId() const
Definition: lib_field.h:115
wxString GetName(bool aUseDefaultName=true) const
Return the field name.
Definition: lib_field.cpp:362
virtual void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
Output the object to aFormatter in s-expression form.
Definition: eda_text.cpp:536
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslate=true)
Return a default symbol field name for field aFieldNdx for all components.
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:426
void SetId(int aId)
Definition: lib_field.h:116
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:154
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:485
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
std::string Quotew(const wxString &aWrapee) const
Definition: richio.cpp:494

References EDA_TEXT::Format(), FormatInternalUnits(), TEMPLATE_FIELDNAME::GetDefaultFieldName(), LIB_FIELD::GetId(), LIB_FIELD::GetName(), LIB_FIELD::GetPosition(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), LIB_FIELD_T, MANDATORY_FIELDS, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), LIB_FIELD::SetId(), and EDA_ITEM::Type().

Referenced by saveDcmInfoAsFields(), and SaveSymbol().

◆ savePin()

void SCH_SEXPR_PLUGIN_CACHE::savePin ( LIB_PIN aPin,
OUTPUTFORMATTER aFormatter,
int  aNestLevel = 0 
)
staticprivate

Definition at line 2015 of file sch_sexpr_plugin.cpp.

2016 {
2017  wxCHECK_RET( aPin && aPin->Type() == LIB_PIN_T, "Invalid LIB_PIN object." );
2018 
2019  aPin->ClearFlags( IS_CHANGED );
2020 
2021  aFormatter.Print( aNestLevel, "(pin %s %s (at %s %s %s) (length %s)",
2023  getPinShapeToken( aPin->GetShape() ),
2024  FormatInternalUnits( aPin->GetPosition().x ).c_str(),
2025  FormatInternalUnits( aPin->GetPosition().y ).c_str(),
2026  FormatAngle( getPinAngle( aPin->GetOrientation() ) * 10.0 ).c_str(),
2027  FormatInternalUnits( aPin->GetLength() ).c_str() );
2028 
2029  if( !aPin->IsVisible() )
2030  aFormatter.Print( 0, " hide\n" );
2031  else
2032  aFormatter.Print( 0, "\n" );
2033 
2034  // This follows the EDA_TEXT effects formatting for future expansion.
2035  aFormatter.Print( aNestLevel + 1, "(name %s (effects (font (size %s %s))))\n",
2036  aFormatter.Quotew( aPin->GetName() ).c_str(),
2037  FormatInternalUnits( aPin->GetNameTextSize() ).c_str(),
2038  FormatInternalUnits( aPin->GetNameTextSize() ).c_str() );
2039 
2040  aFormatter.Print( aNestLevel + 1, "(number %s (effects (font (size %s %s))))\n",
2041  aFormatter.Quotew( aPin->GetNumber() ).c_str(),
2042  FormatInternalUnits( aPin->GetNumberTextSize() ).c_str(),
2043  FormatInternalUnits( aPin->GetNumberTextSize() ).c_str() );
2044 
2045 
2046  for( const std::pair<const wxString, LIB_PIN::ALT>& alt : aPin->GetAlternates() )
2047  {
2048  aFormatter.Print( aNestLevel + 1, "(alternate %s %s %s)\n",
2049  aFormatter.Quotew( alt.second.m_Name ).c_str(),
2050  getPinElectricalTypeToken( alt.second.m_Type ),
2051  getPinShapeToken( alt.second.m_Shape ) );
2052  }
2053 
2054  aFormatter.Print( aNestLevel, ")\n" );
2055 }
#define IS_CHANGED
Item was edited, and modified.
int GetOrientation() const
Definition: lib_pin.h:75
GRAPHIC_PINSHAPE GetShape() const
Definition: lib_pin.h:78
static float getPinAngle(int aOrientation)
static const char * getPinShapeToken(GRAPHIC_PINSHAPE aShape)
std::string FormatAngle(double aAngle)
Function FormatAngle converts aAngle from board units to a string appropriate for writing to file.
Definition: base_units.cpp:520
const wxString & GetName() const
Definition: lib_pin.h:106
static const char * getPinElectricalTypeToken(ELECTRICAL_PINTYPE aType)
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:153
bool IsVisible() const
Definition: lib_pin.h:97
int GetNameTextSize() const
Definition: lib_pin.h:126
wxPoint GetPosition() const override
Definition: lib_pin.h:210
const wxString & GetNumber() const
Definition: lib_pin.h:116
ELECTRICAL_PINTYPE GetType() const
Definition: lib_pin.h:84
std::map< wxString, ALT > & GetAlternates()
Definition: lib_pin.h:132
int GetNumberTextSize() const
Definition: lib_pin.h:129
int GetLength() const
Definition: lib_pin.h:81
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:426
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:485
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
std::string Quotew(const wxString &aWrapee) const
Definition: richio.cpp:494

References EDA_ITEM::ClearFlags(), FormatAngle(), FormatInternalUnits(), LIB_PIN::GetAlternates(), LIB_PIN::GetLength(), LIB_PIN::GetName(), LIB_PIN::GetNameTextSize(), LIB_PIN::GetNumber(), LIB_PIN::GetNumberTextSize(), LIB_PIN::GetOrientation(), getPinAngle(), getPinElectricalTypeToken(), getPinShapeToken(), LIB_PIN::GetPosition(), LIB_PIN::GetShape(), LIB_PIN::GetType(), IS_CHANGED, LIB_PIN::IsVisible(), LIB_PIN_T, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and EDA_ITEM::Type().

Referenced by saveSymbolDrawItem().

◆ SaveSymbol()

void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol ( LIB_SYMBOL aSymbol,
OUTPUTFORMATTER aFormatter,
int  aNestLevel = 0,
const wxString &  aLibName = wxEmptyString 
)
static

Definition at line 1734 of file sch_sexpr_plugin.cpp.

1736 {
1737  wxCHECK_RET( aSymbol, "Invalid LIB_SYMBOL pointer." );
1738 
1739  // The current locale must use period as the decimal point.
1740  wxCHECK2( wxLocale::GetInfo( wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER ) == ".",
1741  LOCALE_IO toggle );
1742 
1743  int nextFreeFieldId = MANDATORY_FIELDS;
1744  std::vector<LIB_FIELD*> fields;
1745  std::string name = aFormatter.Quotew( aSymbol->GetLibId().GetLibItemName().wx_str() );
1746  std::string unitName = aSymbol->GetLibId().GetLibItemName();
1747 
1748  if( !aLibName.IsEmpty() )
1749  {
1750  name = aFormatter.Quotew( aLibName );
1751 
1752  LIB_ID unitId;
1753 
1754  wxCHECK2( unitId.Parse( aLibName ) < 0, /* do nothing */ );
1755 
1756  unitName = unitId.GetLibItemName();
1757  }
1758 
1759  if( aSymbol->IsRoot() )
1760  {
1761  aFormatter.Print( aNestLevel, "(symbol %s", name.c_str() );
1762 
1763  if( aSymbol->IsPower() )
1764  aFormatter.Print( 0, " (power)" );
1765 
1766  // TODO: add uuid token here.
1767 
1768  // TODO: add anchor position token here.
1769 
1770  if( !aSymbol->ShowPinNumbers() )
1771  aFormatter.Print( 0, " (pin_numbers hide)" );
1772 
1773  if( aSymbol->GetPinNameOffset() != Mils2iu( DEFAULT_PIN_NAME_OFFSET )
1774  || !aSymbol->ShowPinNames() )
1775  {
1776  aFormatter.Print( 0, " (pin_names" );
1777 
1778  if( aSymbol->GetPinNameOffset() != Mils2iu( DEFAULT_PIN_NAME_OFFSET ) )
1779  aFormatter.Print( 0, " (offset %s)",
1780  FormatInternalUnits( aSymbol->GetPinNameOffset() ).c_str() );
1781 
1782  if( !aSymbol->ShowPinNames() )
1783  aFormatter.Print( 0, " hide" );
1784 
1785  aFormatter.Print( 0, ")" );
1786  }
1787 
1788  aFormatter.Print( 0, " (in_bom %s)", ( aSymbol->GetIncludeInBom() ) ? "yes" : "no" );
1789  aFormatter.Print( 0, " (on_board %s)", ( aSymbol->GetIncludeOnBoard() ) ? "yes" : "no" );
1790 
1791  // TODO: add atomic token here.
1792 
1793  // TODO: add required token here."
1794 
1795  aFormatter.Print( 0, "\n" );
1796 
1797  aSymbol->GetFields( fields );
1798 
1799  for( LIB_FIELD* field : fields )
1800  saveField( field, aFormatter, nextFreeFieldId, aNestLevel + 1 );
1801 
1802  // @todo At some point in the future the lock status (all units interchangeable) should
1803  // be set deterministically. For now a custom lock property is used to preserve the
1804  // locked flag state.
1805  if( aSymbol->UnitsLocked() )
1806  {
1807  LIB_FIELD locked( -1, "ki_locked" );
1808  saveField( &locked, aFormatter, nextFreeFieldId, aNestLevel + 1 );
1809  }
1810 
1811  saveDcmInfoAsFields( aSymbol, aFormatter, nextFreeFieldId, aNestLevel );
1812 
1813  // Save the draw items grouped by units.
1814  std::vector<LIB_SYMBOL_UNIT> units = aSymbol->GetUnitDrawItems();
1815  std::sort( units.begin(), units.end(),
1816  []( const LIB_SYMBOL_UNIT& a, const LIB_SYMBOL_UNIT& b )
1817  {
1818  if( a.m_unit == b.m_unit )
1819  return a.m_convert < b.m_convert;
1820 
1821  return a.m_unit < b.m_unit;
1822  } );
1823 
1824  for( auto unit : units )
1825  {
1826  // Add quotes and escape chars like ") to the UTF8 unitName string
1827  name = aFormatter.Quotes( unitName );
1828  name.pop_back(); // Remove last char: the quote ending the string.
1829 
1830  aFormatter.Print( aNestLevel + 1, "(symbol %s_%d_%d\"\n",
1831  name.c_str(), unit.m_unit, unit.m_convert );
1832 
1833  // Enforce item ordering
1834  auto cmp =
1835  []( const LIB_ITEM* a, const LIB_ITEM* b )
1836  {
1837  return *a < *b;
1838  };
1839 
1840  std::multiset<LIB_ITEM*, decltype( cmp )> save_map( cmp );
1841 
1842  for( LIB_ITEM* item : unit.m_items )
1843  save_map.insert( item );
1844 
1845  for( LIB_ITEM* item : save_map )
1846  saveSymbolDrawItem( item, aFormatter, aNestLevel + 2 );
1847 
1848  aFormatter.Print( aNestLevel + 1, ")\n" );
1849  }
1850  }
1851  else
1852  {
1853  std::shared_ptr<LIB_SYMBOL> parent = aSymbol->GetParent().lock();
1854 
1855  wxASSERT( parent );
1856 
1857  aFormatter.Print( aNestLevel, "(symbol %s (extends %s)\n",
1858  name.c_str(),
1859  aFormatter.Quotew( parent->GetName() ).c_str() );
1860 
1861  aSymbol->GetFields( fields );
1862 
1863  for( LIB_FIELD* field : fields )
1864  saveField( field, aFormatter, nextFreeFieldId, aNestLevel + 1 );
1865 
1866  saveDcmInfoAsFields( aSymbol, aFormatter, nextFreeFieldId, aNestLevel );
1867  }
1868 
1869  aFormatter.Print( aNestLevel, ")\n" );
1870 }
static void saveField(LIB_FIELD *aField, OUTPUTFORMATTER &aFormatter, int &aNextFreeFieldId, int aNestLevel)
LIB_SYMBOL_REF & GetParent()
Definition: lib_symbol.h:124
int GetPinNameOffset() const
Definition: lib_symbol.h:561
const UTF8 & GetLibItemName() const
Definition: lib_id.h:104
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
Field object used in symbol libraries.
Definition: lib_field.h:59
bool ShowPinNumbers() const
Definition: lib_symbol.h:577
bool GetIncludeOnBoard() const
Definition: lib_symbol.h:593
bool IsPower() const
Definition: lib_symbol.cpp:408
virtual std::string Quotes(const std::string &aWrapee) const
Check aWrapee input string for a need to be quoted (e.g.
Definition: richio.cpp:455
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
int m_unit
The unit number.
Definition: lib_symbol.h:84
std::vector< struct LIB_SYMBOL_UNIT > GetUnitDrawItems()
Return a list of LIB_ITEM objects separated by unit and convert number.
The base class for drawable items used by schematic library symbols.
Definition: lib_item.h:61
void GetFields(std::vector< LIB_FIELD * > &aList)
Return a list of fields within this symbol.
Definition: lib_symbol.cpp:931
int m_convert
The alternate body style of the unit.
Definition: lib_symbol.h:85
LIB_ID GetLibId() const override
Definition: lib_symbol.h:135
bool ShowPinNames() const
Definition: lib_symbol.h:569
#define DEFAULT_PIN_NAME_OFFSET
The intersheets references prefix string.
bool UnitsLocked() const
Check whether symbol units are interchangeable.
Definition: lib_symbol.h:241
The first 4 are mandatory, and must be instantiated in SCH_COMPONENT and LIB_PART constructors.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:49
const char * name
Definition: DXF_plotter.cpp:56
static void saveDcmInfoAsFields(LIB_SYMBOL *aSymbol, OUTPUTFORMATTER &aFormatter, int &aNextFreeFieldId, int aNestLevel)
wxString wx_str() const
Definition: utf8.cpp:46
bool IsRoot() const override
For symbols derived from other symbols, IsRoot() indicates no derivation.
Definition: lib_symbol.h:171
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:426
static void saveSymbolDrawItem(LIB_ITEM *aItem, OUTPUTFORMATTER &aFormatter, int aNestLevel)
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:485
std::string Quotew(const wxString &aWrapee) const
Definition: richio.cpp:494
bool GetIncludeInBom() const
Definition: lib_symbol.h:585

References DEFAULT_PIN_NAME_OFFSET, FormatInternalUnits(), LIB_SYMBOL::GetFields(), LIB_SYMBOL::GetIncludeInBom(), LIB_SYMBOL::GetIncludeOnBoard(), LIB_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), LIB_SYMBOL::GetParent(), LIB_SYMBOL::GetPinNameOffset(), LIB_SYMBOL::GetUnitDrawItems(), LIB_SYMBOL::IsPower(), LIB_SYMBOL::IsRoot(), locked, LIB_SYMBOL_UNIT::m_convert, LIB_SYMBOL_UNIT::m_unit, MANDATORY_FIELDS, name, LIB_ID::Parse(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotes(), OUTPUTFORMATTER::Quotew(), saveDcmInfoAsFields(), saveField(), saveSymbolDrawItem(), LIB_SYMBOL::ShowPinNames(), LIB_SYMBOL::ShowPinNumbers(), LIB_SYMBOL::UnitsLocked(), and UTF8::wx_str().

Referenced by SCH_SEXPR_PLUGIN::Format(), SCH_SEXPR_PLUGIN::FormatLibSymbol(), and Save().

◆ saveSymbolDrawItem()

void SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem ( LIB_ITEM aItem,
OUTPUTFORMATTER aFormatter,
int  aNestLevel 
)
staticprivate

Definition at line 1919 of file sch_sexpr_plugin.cpp.

1921 {
1922  wxCHECK_RET( aItem, "Invalid LIB_ITEM pointer." );
1923 
1924  switch( aItem->Type() )
1925  {
1926  case LIB_SHAPE_T:
1927  {
1928  LIB_SHAPE* shape = static_cast<LIB_SHAPE*>( aItem );
1929  STROKE_PARAMS stroke;
1930  FILL_T fillMode = shape->GetFillType();
1931 
1932  stroke.SetWidth( shape->GetWidth() );
1933 
1934  switch( shape->GetShape() )
1935  {
1936  case SHAPE_T::ARC:
1937  int x1;
1938  int x2;
1939 
1940  shape->CalcArcAngles( x1, x2 );
1941 
1942  formatArc( &aFormatter, aNestLevel, shape, x1, x2, stroke, fillMode, COLOR4D() );
1943  break;
1944 
1945  case SHAPE_T::CIRCLE:
1946  formatCircle( &aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
1947  break;
1948 
1949  case SHAPE_T::RECT:
1950  formatRect( &aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
1951  break;
1952 
1953  case SHAPE_T::BEZIER:
1954  formatBezier(&aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
1955  break;
1956 
1957  case SHAPE_T::POLY:
1958  formatPoly( &aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
1959  break;
1960 
1961  default:
1962  UNIMPLEMENTED_FOR( shape->SHAPE_T_asString() );
1963  }
1964 
1965  break;
1966  }
1967 
1968  case LIB_PIN_T:
1969  savePin( (LIB_PIN* ) aItem, aFormatter, aNestLevel );
1970  break;
1971 
1972  case LIB_TEXT_T:
1973  saveText( ( LIB_TEXT* ) aItem, aFormatter, aNestLevel );
1974  break;
1975 
1976  default:
1977  UNIMPLEMENTED_FOR( aItem->GetClass() );
1978  }
1979 }
void CalcArcAngles(int &aStartAngle, int &aEndAngle) const
Definition: lib_shape.cpp:423
void SetWidth(int aWidth)
Definition: sch_item.h:153
int GetWidth() const
Definition: eda_shape.h:89
static void saveText(LIB_TEXT *aText, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
Define a symbol library graphical text item.
Definition: lib_text.h:39
static void formatPoly(OUTPUTFORMATTER *aFormatter, int aNestLevel, EDA_SHAPE *aPolyLine, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, KIID aUuid=niluuid)
static void formatCircle(OUTPUTFORMATTER *aFormatter, int aNestLevel, EDA_SHAPE *aCircle, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, KIID aUuid=niluuid)
FILL_T
Definition: eda_shape.h:53
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:120
static void savePin(LIB_PIN *aPin, OUTPUTFORMATTER &aFormatter, int aNestLevel=0)
static void formatBezier(OUTPUTFORMATTER *aFormatter, int aNestLevel, EDA_SHAPE *aBezier, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, KIID aUuid=niluuid)
wxString SHAPE_T_asString() const
Definition: eda_shape.cpp:71
static void formatArc(OUTPUTFORMATTER *aFormatter, int aNestLevel, EDA_SHAPE *aArc, int x1, int x2, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, KIID aUuid=niluuid)
virtual wxString GetClass() const =0
Return the class name.
Simple container to manage line stroke parameters.
Definition: sch_item.h:140
static void formatRect(OUTPUTFORMATTER *aFormatter, int aNestLevel, EDA_SHAPE *aRect, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, KIID aUuid=niluuid)
SHAPE_T GetShape() const
Definition: eda_shape.h:92
FILL_T GetFillType() const
Definition: eda_shape.h:79
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103

References ARC, BEZIER, LIB_SHAPE::CalcArcAngles(), CIRCLE, formatArc(), formatBezier(), formatCircle(), formatPoly(), formatRect(), LIB_TEXT::GetClass(), EDA_SHAPE::GetFillType(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetWidth(), LIB_PIN_T, LIB_SHAPE_T, LIB_TEXT_T, POLY, RECT, savePin(), saveText(), STROKE_PARAMS::SetWidth(), EDA_SHAPE::SHAPE_T_asString(), EDA_ITEM::Type(), and UNIMPLEMENTED_FOR.

Referenced by SaveSymbol().

◆ saveText()

void SCH_SEXPR_PLUGIN_CACHE::saveText ( LIB_TEXT aText,
OUTPUTFORMATTER aFormatter,
int  aNestLevel = 0 
)
staticprivate

Definition at line 2058 of file sch_sexpr_plugin.cpp.

2060 {
2061  wxCHECK_RET( aText && aText->Type() == LIB_TEXT_T, "Invalid LIB_TEXT object." );
2062 
2063  aFormatter.Print( aNestLevel, "(text %s (at %s %s %g)\n",
2064  aFormatter.Quotew( aText->GetText() ).c_str(),
2065  FormatInternalUnits( aText->GetPosition().x ).c_str(),
2066  FormatInternalUnits( aText->GetPosition().y ).c_str(),
2067  aText->GetTextAngle() );
2068  aText->Format( &aFormatter, aNestLevel, 0 );
2069  aFormatter.Print( aNestLevel, ")\n" );
2070 }
wxPoint GetPosition() const override
Definition: lib_text.h:91
double GetTextAngle() const
Definition: eda_text.h:195
virtual void Format(OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
Output the object to aFormatter in s-expression form.
Definition: eda_text.cpp:536
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:426
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:154
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:485
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
std::string Quotew(const wxString &aWrapee) const
Definition: richio.cpp:494

References EDA_TEXT::Format(), FormatInternalUnits(), LIB_TEXT::GetPosition(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), LIB_TEXT_T, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and EDA_ITEM::Type().

Referenced by saveSymbolDrawItem().

◆ SetFileName()

void SCH_SEXPR_PLUGIN_CACHE::SetFileName ( const wxString &  aFileName)
inline

Definition at line 490 of file sch_sexpr_plugin.cpp.

490 { m_libFileName = aFileName; }

Referenced by SCH_SEXPR_PLUGIN::SaveLibrary().

◆ SetModified()

void SCH_SEXPR_PLUGIN_CACHE::SetModified ( bool  aModified = true)
inline

Member Data Documentation

◆ m_fileModTime

wxDateTime SCH_SEXPR_PLUGIN_CACHE::m_fileModTime
private

Definition at line 437 of file sch_sexpr_plugin.cpp.

Referenced by IsFileChanged(), Load(), and Save().

◆ m_fileName

wxString SCH_SEXPR_PLUGIN_CACHE::m_fileName
private

Definition at line 435 of file sch_sexpr_plugin.cpp.

Referenced by IsFile().

◆ m_isModified

bool SCH_SEXPR_PLUGIN_CACHE::m_isModified
private

Definition at line 440 of file sch_sexpr_plugin.cpp.

Referenced by AddSymbol(), DeleteSymbol(), removeSymbol(), and Save().

◆ m_isWritable

bool SCH_SEXPR_PLUGIN_CACHE::m_isWritable
private

Definition at line 439 of file sch_sexpr_plugin.cpp.

Referenced by GetLibModificationTime().

◆ m_libFileName

wxFileName SCH_SEXPR_PLUGIN_CACHE::m_libFileName
private

Definition at line 436 of file sch_sexpr_plugin.cpp.

Referenced by DeleteSymbol(), GetRealFile(), Load(), and removeSymbol().

◆ m_libType

SCH_LIB_TYPE SCH_SEXPR_PLUGIN_CACHE::m_libType
private

Definition at line 442 of file sch_sexpr_plugin.cpp.

Referenced by SCH_SEXPR_PLUGIN_CACHE().

◆ m_modHash

int SCH_SEXPR_PLUGIN_CACHE::m_modHash = 1
staticprivate

Definition at line 433 of file sch_sexpr_plugin.cpp.

Referenced by AddSymbol(), DeleteSymbol(), Load(), and removeSymbol().

◆ m_symbols

◆ m_versionMajor

int SCH_SEXPR_PLUGIN_CACHE::m_versionMajor
private

Definition at line 441 of file sch_sexpr_plugin.cpp.

Referenced by SCH_SEXPR_PLUGIN_CACHE().

◆ SCH_SEXPR_PLUGIN

friend SCH_SEXPR_PLUGIN_CACHE::SCH_SEXPR_PLUGIN
private

Definition at line 456 of file sch_sexpr_plugin.cpp.


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