KiCad PCB EDA Suite
PART_LIB Class Reference

Class PART_LIB is used to load, save, search, and otherwise manipulate part library files. More...

#include <class_library.h>

Public Member Functions

 PART_LIB (int aType, const wxString &aFileName, SCH_IO_MGR::SCH_FILE_T aPluginType=SCH_IO_MGR::SCH_LEGACY)
 
 ~PART_LIB ()
 
int GetModHash () const
 
SCH_IO_MGR::SCH_FILE_T GetPluginType () const
 
void SetPluginType (SCH_IO_MGR::SCH_FILE_T aPluginType)
 
void Create (const wxString &aFileName=wxEmptyString)
 
void SetFileName (const wxString &aFileName)
 
bool IsEmpty () const
 Get library entry status. More...
 
int GetCount () const
 Function GetCount returns the number of entries in the library. More...
 
bool IsModified () const
 
bool IsCache () const
 
void SetCache ()
 
bool IsBuffering () const
 
void EnableBuffering (bool aEnable=true)
 
void Save (bool aSaveDocFile=true)
 
bool IsReadOnly () const
 Function IsReadOnly. More...
 
void GetAliasNames (wxArrayString &aNames)
 Load a string array with the names of all the entries in this library. More...
 
void GetAliases (std::vector< LIB_ALIAS * > &aAliases)
 Load a vector with all the entries in this library. More...
 
void GetEntryTypePowerNames (wxArrayString &aNames)
 Load a string array with the names of entries of type POWER in this library. More...
 
LIB_ALIASFindAlias (const wxString &aName)
 Find LIB_ALIAS by aName. More...
 
LIB_PARTFindPart (const wxString &aName)
 Find part by aName. More...
 
void AddPart (LIB_PART *aPart)
 Add aPart entry to library. More...
 
LIB_ALIASRemoveAlias (LIB_ALIAS *aEntry)
 Safely remove aEntry from the library and return the next entry. More...
 
LIB_PARTReplacePart (LIB_PART *aOldPart, LIB_PART *aNewPart)
 Replace an existing part entry in the library. More...
 
const wxString GetName () const
 Return the file name without path or extension. More...
 
wxString GetFullFileName ()
 Function GetFullFileName returns the full file library name with path and extension. More...
 
const wxString GetLogicalName ()
 Function GetLogicalName returns the logical name of the library. More...
 
bool HasPowerParts ()
 Function HasPowerParts. More...
 

Static Public Member Functions

static PART_LIBLoadLibrary (const wxString &aFileName) throw ( IO_ERROR, boost::bad_pointer )
 Function LoadLibrary allocates and loads a part library file. More...
 

Private Attributes

int type
 Library type indicator. More...
 
wxFileName fileName
 Library file name. More...
 
wxDateTime timeStamp
 Library save time and date. More...
 
int versionMajor
 Library major version number. More...
 
int versionMinor
 Library minor version number. More...
 
wxString header
 first line of loaded library. More...
 
bool isModified
 Library modification status. More...
 
int m_mod_hash
 incremented each time library is changed. More...
 
SCH_IO_MGR::SCH_FILE_T m_pluginType
 
std::unique_ptr< SCH_PLUGINm_plugin
 
std::unique_ptr< PROPERTIESm_properties
 Library properties. More...
 

Detailed Description

Class PART_LIB is used to load, save, search, and otherwise manipulate part library files.

Definition at line 325 of file class_library.h.

Constructor & Destructor Documentation

PART_LIB::PART_LIB ( int  aType,
const wxString &  aFileName,
SCH_IO_MGR::SCH_FILE_T  aPluginType = SCH_IO_MGR::SCH_LEGACY 
)

Definition at line 58 of file class_library.cpp.

References fileName, SCH_IO_MGR::FindPlugin(), isModified, m_plugin, m_pluginType, m_properties, timeStamp, type, versionMajor, and versionMinor.

58  :
59  // start @ != 0 so each additional library added
60  // is immediately detectable, zero would not be.
62  m_pluginType( aPluginType )
63 {
64  type = aType;
65  isModified = false;
66  timeStamp = 0;
67  timeStamp = wxDateTime::Now();
68  versionMajor = 0; // Will be updated after reading the lib file
69  versionMinor = 0; // Will be updated after reading the lib file
70 
71  fileName = aFileName;
72 
73  if( !fileName.IsOk() )
74  fileName = "unnamed.lib";
75 
77  m_properties = std::make_unique<PROPERTIES>();
78 }
int m_mod_hash
incremented each time library is changed.
std::unique_ptr< SCH_PLUGIN > m_plugin
static int s_modify_generation
helper for GetModifyHash()
bool isModified
Library modification status.
static SCH_PLUGIN * FindPlugin(SCH_FILE_T aFileType)
Function FindPlugin returns a SCH_PLUGIN which the caller can use to import, export, save, or load design documents.
Definition: sch_io_mgr.cpp:48
int type
Library type indicator.
wxDateTime timeStamp
Library save time and date.
std::unique_ptr< PROPERTIES > m_properties
Library properties.
SCH_IO_MGR::SCH_FILE_T m_pluginType
wxFileName fileName
Library file name.
int versionMinor
Library minor version number.
int versionMajor
Library major version number.
PART_LIB::~PART_LIB ( )

Definition at line 81 of file class_library.cpp.

82 {
83 }

Member Function Documentation

void PART_LIB::AddPart ( LIB_PART aPart)

Add aPart entry to library.

Note
A LIB_PART can have an alias list so these alias will be added in library. and the any existing duplicate aliases will be removed from the library.
Parameters
aPart- Part to add, caller retains ownership, a clone is added.

Definition at line 227 of file class_library.cpp.

References fileName, IsBuffering(), isModified, m_mod_hash, m_plugin, and m_properties.

Referenced by SCH_EDIT_FRAME::CreateArchiveLibrary(), and LIB_EDIT_FRAME::SaveOnePart().

228 {
229  // add a clone, not the caller's copy, the plugin take ownership of the new symbol.
230  m_plugin->SaveSymbol( fileName.GetFullPath(), new LIB_PART( *aPart, this ), m_properties.get() );
231 
232  // If we are not buffering, the library file is updated immediately when the plugin
233  // SaveSymbol() function is called.
234  if( IsBuffering() )
235  isModified = true;
236 
237  ++m_mod_hash;
238 }
int m_mod_hash
incremented each time library is changed.
bool IsBuffering() const
std::unique_ptr< SCH_PLUGIN > m_plugin
bool isModified
Library modification status.
Class LIB_PART defines a library part object.
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
void PART_LIB::Create ( const wxString &  aFileName = wxEmptyString)

Definition at line 101 of file class_library.cpp.

References fileName, m_plugin, and m_properties.

Referenced by LIB_EDIT_FRAME::SaveOnePart().

102 {
103  wxString tmpFileName = fileName.GetFullPath();
104 
105  if( !aFileName.IsEmpty() )
106  tmpFileName = aFileName;
107 
108  m_plugin->CreateSymbolLib( tmpFileName, m_properties.get() );
109 }
std::unique_ptr< SCH_PLUGIN > m_plugin
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
void PART_LIB::EnableBuffering ( bool  aEnable = true)

Definition at line 140 of file class_library.cpp.

References m_properties, and SCH_LEGACY_PLUGIN::PropBuffering.

Referenced by SCH_EDIT_FRAME::CreateArchiveLibrary(), and LIB_EDIT_FRAME::SaveActiveLibrary().

141 {
142  if( aEnable )
143  (*m_properties)[ SCH_LEGACY_PLUGIN::PropBuffering ] = "";
144  else
146 }
std::unique_ptr< PROPERTIES > m_properties
Library properties.
static const char * PropBuffering
const char* PropBuffering
LIB_ALIAS * PART_LIB::FindAlias ( const wxString &  aName)

Find LIB_ALIAS by aName.

Parameters
aName- Name of entry, case sensitive.
Returns
LIB_ALIAS* if found. NULL if not found.

Definition at line 189 of file class_library.cpp.

References fileName, m_plugin, and m_properties.

Referenced by CMP_TREE_MODEL_ADAPTER::AddAliasList(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::AddAliasOfPart(), SCH_EDIT_FRAME::CreateArchiveLibrary(), LIB_EDIT_FRAME::CreateNewLibraryPart(), LIB_EDIT_FRAME::EditField(), PART_LIBS::FindLibraryAlias(), PART_LIBS::FindLibraryNearEntries(), FindPart(), LIB_VIEW_FRAME::getSelectedAlias(), and LIB_EDIT_FRAME::LoadOneLibraryPart().

190 {
191  return m_plugin->LoadSymbol( fileName.GetFullPath(), aName, m_properties.get() );
192 }
std::unique_ptr< SCH_PLUGIN > m_plugin
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
LIB_PART * PART_LIB::FindPart ( const wxString &  aName)

Find part by aName.

This is a helper for FindEntry so casting a LIB_ALIAS pointer to a LIB_PART pointer is not required.

Parameters
aName- Name of part, case sensitive.
Returns
LIB_PART* - part if found, else NULL.

Definition at line 195 of file class_library.cpp.

References FindAlias(), and LIB_ALIAS::GetPart().

Referenced by LIB_VIEW_FRAME::BestZoom(), PART_LIBS::FindLibPart(), and LIB_EDIT_FRAME::SaveOnePart().

196 {
197  LIB_ALIAS* alias = FindAlias( aName );
198 
199  if( alias != NULL )
200  return alias->GetPart();
201 
202  return NULL;
203 }
Part library alias object definition.
LIB_PART * GetPart() const
Function GetPart gets the shared LIB_PART.
LIB_ALIAS * FindAlias(const wxString &aName)
Find LIB_ALIAS by aName.
void PART_LIB::GetAliases ( std::vector< LIB_ALIAS * > &  aAliases)

Load a vector with all the entries in this library.

Parameters
aAliases- vector to receive the aliases.

Definition at line 157 of file class_library.cpp.

References fileName, LIB_ALIAS::GetName(), m_plugin, and m_properties.

Referenced by CMP_TREE_MODEL_ADAPTER::AddLibrary().

158 {
159  m_plugin->EnumerateSymbolLib( aAliases, fileName.GetFullPath(), m_properties.get() );
160 
161  std::sort( aAliases.begin(), aAliases.end(),
162  [](LIB_ALIAS *lhs, LIB_ALIAS *rhs) -> bool
163  { return lhs->GetName() < rhs->GetName(); });
164 }
Part library alias object definition.
std::unique_ptr< SCH_PLUGIN > m_plugin
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
const wxString & GetName() const
void PART_LIB::GetAliasNames ( wxArrayString &  aNames)

Load a string array with the names of all the entries in this library.

Parameters
aNames- String array to place entry names into.

Definition at line 149 of file class_library.cpp.

References fileName, m_plugin, and m_properties.

Referenced by SCH_BASE_FRAME::DisplayListComponentsInLib(), LIB_EDIT_FRAME::EditField(), PART_LIBS::FindLibraryNearEntries(), and LIB_VIEW_FRAME::ReCreateListCmp().

150 {
151  m_plugin->EnumerateSymbolLib( aNames, fileName.GetFullPath(), m_properties.get() );
152 
153  aNames.Sort();
154 }
std::unique_ptr< SCH_PLUGIN > m_plugin
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
int PART_LIB::GetCount ( ) const
inline

Function GetCount returns the number of entries in the library.

Returns
The number of part and alias entries.

Definition at line 371 of file class_library.h.

Referenced by LIB_EDIT_FRAME::SaveActiveLibrary().

372  {
373  return (int) m_plugin->GetSymbolLibCount( fileName.GetFullPath() );
374  }
std::unique_ptr< SCH_PLUGIN > m_plugin
wxFileName fileName
Library file name.
void PART_LIB::GetEntryTypePowerNames ( wxArrayString &  aNames)

Load a string array with the names of entries of type POWER in this library.

Parameters
aNames- String array to place entry names into.

Definition at line 167 of file class_library.cpp.

References fileName, LIB_ALIAS::GetName(), LIB_ALIAS::GetPart(), LIB_PART::IsPower(), m_plugin, and EDA_ITEM::Sort().

Referenced by CMP_TREE_MODEL_ADAPTER::AddLibrary(), and LIB_VIEW_FRAME::ReCreateListCmp().

168 {
169  std::vector<LIB_ALIAS*> aliases;
170 
171  m_plugin->EnumerateSymbolLib( aliases, fileName.GetFullPath() );
172 
173  for( size_t i = 0; i < aliases.size(); i++ )
174  {
175  LIB_ALIAS* alias = aliases[i];
176 
177  LIB_PART* root = alias->GetPart();
178 
179  if( !root || !root->IsPower() )
180  continue;
181 
182  aNames.Add( alias->GetName() );
183  }
184 
185  aNames.Sort();
186 }
Part library alias object definition.
std::unique_ptr< SCH_PLUGIN > m_plugin
bool IsPower() const
Class LIB_PART defines a library part object.
static bool Sort(const EDA_ITEM *aLeft, const EDA_ITEM *aRight)
Function Sort is a helper function to be used by the C++ STL sort algorithm for sorting a STL contain...
Definition: base_struct.h:463
LIB_PART * GetPart() const
Function GetPart gets the shared LIB_PART.
wxFileName fileName
Library file name.
const wxString & GetName() const
wxString PART_LIB::GetFullFileName ( )
inline

Function GetFullFileName returns the full file library name with path and extension.

Returns
wxString - Full library file name with path and extension.

Definition at line 482 of file class_library.h.

Referenced by LIB_VIEW_FRAME::DisplayLibInfos(), LIB_EDIT_FRAME::DisplayLibInfos(), NETLIST_EXPORTER_GENERIC::makeLibraries(), save_library(), LIB_EDIT_FRAME::SaveActiveLibrary(), and LIB_EDIT_FRAME::SaveOnePart().

482 { return fileName.GetFullPath(); }
wxFileName fileName
Library file name.
const wxString PART_LIB::GetLogicalName ( )
inline

Function GetLogicalName returns the logical name of the library.

Returns
wxString - The logical name of this library.

Definition at line 489 of file class_library.h.

Referenced by SCH_BASE_FRAME::DisplayListComponentsInLib(), NETLIST_EXPORTER_GENERIC::makeComponents(), NETLIST_EXPORTER_GENERIC::makeLibParts(), and NETLIST_EXPORTER_GENERIC::makeLibraries().

490  {
491  /* for now is the filename without path or extension.
492 
493  Technically the library should not know its logical name!
494  This will eventually come out of a pair of lookup tables using a
495  reverse lookup using the full name or library pointer as a key.
496  Search will be by project lookup table and then user lookup table if
497  not found.
498  */
499  return fileName.GetName();
500  }
wxFileName fileName
Library file name.
int PART_LIB::GetModHash ( ) const
inline

Definition at line 345 of file class_library.h.

References m_mod_hash.

345 { return m_mod_hash; }
int m_mod_hash
incremented each time library is changed.
SCH_IO_MGR::SCH_FILE_T PART_LIB::GetPluginType ( ) const
inline

Definition at line 347 of file class_library.h.

References m_pluginType.

347 { return m_pluginType; }
SCH_IO_MGR::SCH_FILE_T m_pluginType
bool PART_LIB::HasPowerParts ( )

Function HasPowerParts.

Returns
true if at least one power part is found in lib Useful to select or list only libs containing power parts

Definition at line 206 of file class_library.cpp.

References fileName, LIB_ALIAS::GetPart(), LIB_PART::IsPower(), m_plugin, and m_properties.

Referenced by LIB_VIEW_FRAME::ReCreateListLib().

207 {
208  // return true if at least one power part is found in lib
209  std::vector<LIB_ALIAS*> aliases;
210 
211  m_plugin->EnumerateSymbolLib( aliases, fileName.GetFullPath(), m_properties.get() );
212 
213  for( size_t i = 0; i < aliases.size(); i++ )
214  {
215  LIB_ALIAS* alias = aliases[i];
216 
217  LIB_PART* root = alias->GetPart();
218 
219  if( !root || root->IsPower() )
220  return true;
221  }
222 
223  return false;
224 }
Part library alias object definition.
std::unique_ptr< SCH_PLUGIN > m_plugin
bool IsPower() const
Class LIB_PART defines a library part object.
std::unique_ptr< PROPERTIES > m_properties
Library properties.
LIB_PART * GetPart() const
Function GetPart gets the shared LIB_PART.
wxFileName fileName
Library file name.
bool PART_LIB::IsBuffering ( ) const

Definition at line 134 of file class_library.cpp.

References m_properties, and SCH_LEGACY_PLUGIN::PropBuffering.

Referenced by AddPart(), RemoveAlias(), and ReplacePart().

135 {
137 }
std::unique_ptr< PROPERTIES > m_properties
Library properties.
static const char * PropBuffering
const char* PropBuffering
bool PART_LIB::IsCache ( ) const

Definition at line 122 of file class_library.cpp.

References m_properties, and SCH_LEGACY_PLUGIN::PropNoDocFile.

Referenced by PART_LIBS::GetLibraryNames().

123 {
125 }
std::unique_ptr< PROPERTIES > m_properties
Library properties.
static const char * PropNoDocFile
const char* PropBuffering
bool PART_LIB::IsEmpty ( ) const
inline

Get library entry status.

Returns
True if there are no entries in the library.

Definition at line 360 of file class_library.h.

Referenced by LIB_VIEW_FRAME::ReCreateListCmp().

361  {
362  return m_plugin->GetSymbolLibCount( fileName.GetFullPath() ) == 0;
363  }
std::unique_ptr< SCH_PLUGIN > m_plugin
wxFileName fileName
Library file name.
bool PART_LIB::IsModified ( ) const
inline

Definition at line 376 of file class_library.h.

References isModified.

Referenced by LIB_EDIT_FRAME::OnUpdateSaveCurrentLib().

377  {
378  return isModified;
379  }
bool isModified
Library modification status.
bool PART_LIB::IsReadOnly ( ) const
inline

Function IsReadOnly.

Returns
true if current user does not have write access to the library file.

Definition at line 395 of file class_library.h.

Referenced by LIB_EDIT_FRAME::DisplayLibInfos(), and LIB_EDIT_FRAME::OnUpdateSaveCurrentLib().

395 { return !fileName.IsFileWritable(); }
wxFileName fileName
Library file name.
PART_LIB * PART_LIB::LoadLibrary ( const wxString &  aFileName)
throw ( IO_ERROR,
boost::bad_pointer
)
static

Function LoadLibrary allocates and loads a part library file.

Parameters
aFileName- File name of the part library to load.
Returns
PART_LIB* - the allocated and loaded PART_LIB, which is owned by the caller.
Exceptions
IO_ERRORif there's any problem loading the library.

Definition at line 278 of file class_library.cpp.

References LIB_ALIAS::GetPart(), LIBRARY_TYPE_EESCHEMA, and LIB_PART::SetLib().

Referenced by PART_LIBS::AddLibrary(), and LIB_EDIT_FRAME::OnImportPart().

279 {
280  std::unique_ptr<PART_LIB> lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) );
281 
282  std::vector<LIB_ALIAS*> aliases;
283  // This loads the library.
284  lib->GetAliases( aliases );
285 
286  // Now, set the LIB_PART m_library member but it will only be used
287  // when loading legacy libraries in the future. Once the symbols in the
288  // schematic have a full #LIB_ID, this will not get called.
289  for( size_t ii = 0; ii < aliases.size(); ii++ )
290  {
291  LIB_ALIAS* alias = aliases[ii];
292 
293  if( alias->GetPart() )
294  alias->GetPart()->SetLib( lib.get() );
295  }
296 
297  PART_LIB* ret = lib.release();
298  return ret;
299 }
void SetLib(PART_LIB *aLibrary)
Part library alias object definition.
LIB_PART * GetPart() const
Function GetPart gets the shared LIB_PART.
PART_LIB(int aType, const wxString &aFileName, SCH_IO_MGR::SCH_FILE_T aPluginType=SCH_IO_MGR::SCH_LEGACY)
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
LIB_ALIAS * PART_LIB::RemoveAlias ( LIB_ALIAS aEntry)

Safely remove aEntry from the library and return the next entry.

The next entry returned depends on the entry being removed. If the entry being remove also removes the part, then the next entry from the list is returned. If the entry being used only removes an alias from a part, then the next alias of the part is returned.

Parameters
aEntry- Entry to remove from library.
Returns
The next entry in the library or NULL if the library is empty.

Definition at line 241 of file class_library.cpp.

References fileName, LIB_ALIAS::GetName(), IsBuffering(), isModified, m_mod_hash, m_plugin, and m_properties.

Referenced by LIB_EDIT_FRAME::DeleteOnePart().

242 {
243  wxCHECK_MSG( aEntry != NULL, NULL, "NULL pointer cannot be removed from library." );
244 
245  m_plugin->DeleteAlias( fileName.GetFullPath(), aEntry->GetName(), m_properties.get() );
246 
247  // If we are not buffering, the library file is updated immediately when the plugin
248  // SaveSymbol() function is called.
249  if( IsBuffering() )
250  isModified = true;
251 
252  ++m_mod_hash;
253  return NULL;
254 }
int m_mod_hash
incremented each time library is changed.
bool IsBuffering() const
std::unique_ptr< SCH_PLUGIN > m_plugin
bool isModified
Library modification status.
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
const wxString & GetName() const
LIB_PART * PART_LIB::ReplacePart ( LIB_PART aOldPart,
LIB_PART aNewPart 
)

Replace an existing part entry in the library.

Note a part can have an alias list, so these alias will be added in library (and previously existing alias removed)

Parameters
aOldPart- The part to replace.
aNewPart- The new part.

Definition at line 257 of file class_library.cpp.

References fileName, LIB_PART::GetName(), IsBuffering(), isModified, m_mod_hash, m_plugin, and m_properties.

Referenced by LIB_EDIT_FRAME::SaveOnePart().

258 {
259  wxASSERT( aOldPart != NULL );
260  wxASSERT( aNewPart != NULL );
261 
262  m_plugin->DeleteSymbol( fileName.GetFullPath(), aOldPart->GetName(), m_properties.get() );
263 
264  LIB_PART* my_part = new LIB_PART( *aNewPart, this );
265 
266  m_plugin->SaveSymbol( fileName.GetFullPath(), my_part, m_properties.get() );
267 
268  // If we are not buffering, the library file is updated immediately when the plugin
269  // SaveSymbol() function is called.
270  if( IsBuffering() )
271  isModified = true;
272 
273  ++m_mod_hash;
274  return my_part;
275 }
int m_mod_hash
incremented each time library is changed.
bool IsBuffering() const
std::unique_ptr< SCH_PLUGIN > m_plugin
bool isModified
Library modification status.
const wxString & GetName() const
Class LIB_PART defines a library part object.
std::unique_ptr< PROPERTIES > m_properties
Library properties.
wxFileName fileName
Library file name.
void PART_LIB::Save ( bool  aSaveDocFile = true)

Definition at line 86 of file class_library.cpp.

References fileName, Format(), isModified, m_plugin, and SCH_LEGACY_PLUGIN::PropNoDocFile.

Referenced by SCH_EDIT_FRAME::CreateArchiveLibrary(), save_library(), and LIB_EDIT_FRAME::SaveActiveLibrary().

87 {
88  wxCHECK_RET( m_plugin != NULL, wxString::Format( "no plugin defined for library `%s`.",
89  fileName.GetFullPath() ) );
90 
91  PROPERTIES props;
92 
93  if( !aSaveDocFile )
95 
96  m_plugin->SaveLibrary( fileName.GetFullPath(), &props );
97  isModified = false;
98 }
std::unique_ptr< SCH_PLUGIN > m_plugin
bool isModified
Library modification status.
Class PROPERTIES is a name/value tuple with unique names and optional values.
Definition: properties.h:34
static const char * PropNoDocFile
const char* PropBuffering
wxFileName fileName
Library file name.
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
void PART_LIB::SetCache ( )

Definition at line 128 of file class_library.cpp.

References SCH_LEGACY_PLUGIN::PropNoDocFile.

Referenced by SCH_EDIT_FRAME::CreateArchiveLibrary().

129 {
130  (*m_properties)[ SCH_LEGACY_PLUGIN::PropNoDocFile ] = "";
131 }
static const char * PropNoDocFile
const char* PropBuffering
void PART_LIB::SetFileName ( const wxString &  aFileName)
inline

Definition at line 353 of file class_library.h.

Referenced by LIB_EDIT_FRAME::SaveActiveLibrary().

353 { fileName = aFileName; }
wxFileName fileName
Library file name.
void PART_LIB::SetPluginType ( SCH_IO_MGR::SCH_FILE_T  aPluginType)

Definition at line 112 of file class_library.cpp.

References SCH_IO_MGR::FindPlugin(), m_plugin, and m_pluginType.

113 {
114  if( m_pluginType != aPluginType )
115  {
116  m_pluginType = aPluginType;
118  }
119 }
std::unique_ptr< SCH_PLUGIN > m_plugin
static SCH_PLUGIN * FindPlugin(SCH_FILE_T aFileType)
Function FindPlugin returns a SCH_PLUGIN which the caller can use to import, export, save, or load design documents.
Definition: sch_io_mgr.cpp:48
SCH_IO_MGR::SCH_FILE_T m_pluginType

Member Data Documentation

wxFileName PART_LIB::fileName
private
wxString PART_LIB::header
private

first line of loaded library.

Definition at line 332 of file class_library.h.

bool PART_LIB::isModified
private

Library modification status.

Definition at line 333 of file class_library.h.

Referenced by AddPart(), IsModified(), PART_LIB(), RemoveAlias(), ReplacePart(), and Save().

int PART_LIB::m_mod_hash
private

incremented each time library is changed.

Definition at line 334 of file class_library.h.

Referenced by AddPart(), GetModHash(), RemoveAlias(), and ReplacePart().

std::unique_ptr< SCH_PLUGIN > PART_LIB::m_plugin
private
SCH_IO_MGR::SCH_FILE_T PART_LIB::m_pluginType
private

Definition at line 336 of file class_library.h.

Referenced by GetPluginType(), PART_LIB(), and SetPluginType().

std::unique_ptr< PROPERTIES > PART_LIB::m_properties
private
wxDateTime PART_LIB::timeStamp
private

Library save time and date.

Definition at line 329 of file class_library.h.

Referenced by PART_LIB().

int PART_LIB::type
private

Library type indicator.

Definition at line 327 of file class_library.h.

Referenced by PART_LIB().

int PART_LIB::versionMajor
private

Library major version number.

Definition at line 330 of file class_library.h.

Referenced by PART_LIB().

int PART_LIB::versionMinor
private

Library minor version number.

Definition at line 331 of file class_library.h.

Referenced by PART_LIB().


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