KiCad PCB EDA Suite
LIB_ID Class Reference

Class LIB_ID. More...

#include <lib_id.h>

Public Member Functions

 LIB_ID ()
 
 LIB_ID (const UTF8 &aId)
 Constructor LIB_ID. More...
 
 LIB_ID (const wxString &aId)
 
 LIB_ID (const wxString &aLibName, const wxString &aLibItemName, const wxString &aRevision=wxEmptyString)
 This LIB_ID ctor is a special version which ignores the parsing due to symbol names allowing '/' as a valid character. More...
 
int Parse (const UTF8 &aId)
 Function Parse. More...
 
const UTF8GetLibNickname () const
 Function GetLibNickname. More...
 
int SetLibNickname (const UTF8 &aNickname)
 Function SetLibNickname. More...
 
const UTF8GetLibItemName () const
 Function GetLibItemName. More...
 
int SetLibItemName (const UTF8 &aLibItemName, bool aTestForRev=true)
 Function SetLibItemName. More...
 
int SetRevision (const UTF8 &aRevision)
 
const UTF8GetRevision () const
 
UTF8 GetLibItemNameAndRev () const
 
UTF8 Format () const
 Function Format. More...
 
bool IsValid () const
 Function IsValid. More...
 
bool IsLegacy () const
 Function IsLegacy. More...
 
void clear ()
 Function clear. More...
 
bool empty () const
 Function empty. More...
 
int compare (const LIB_ID &aLibId) const
 Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname, library entry name, and revision strings respectively. More...
 
bool operator< (const LIB_ID &aLibId) const
 
bool operator> (const LIB_ID &aLibId) const
 
bool operator== (const LIB_ID &aLibId) const
 
bool operator!= (const LIB_ID &aLibId) const
 

Static Public Member Functions

static UTF8 Format (const UTF8 &aLibNickname, const UTF8 &aLibItemName, const UTF8 &aRevision="")
 Function Format. More...
 

Protected Attributes

UTF8 nickname
 The nickname of the library or empty. More...
 
UTF8 item_name
 The name of the entry in the logical library. More...
 
UTF8 revision
 The revision of the entry. More...
 

Detailed Description

Class LIB_ID.

is a logical library item identifier and consists of various portions much like a URI. It consists of of triad of the library nickname, the name of the item in the library, and an optional revision of the item. This is a generic library identifier that can be used for any type of library that contains multiple named items such as footprint or symbol libraries.

Example LIB_ID string: "smt:R_0805/rev0".

  • "smt" is the logical library name used to look up library information saved in the LIB_TABLE.
  • "R" is the name of the item within the library.
  • "rev0" is the revision, which is optional. If missing then its / delimiter should also not be present. A revision must begin with "rev" and be followed by at least one or more decimal digits.
Author
Dick Hollenbeck

Definition at line 56 of file lib_id.h.

Constructor & Destructor Documentation

LIB_ID::LIB_ID ( )
inline

Definition at line 60 of file lib_id.h.

60 {}
LIB_ID::LIB_ID ( const UTF8 aId)

Constructor LIB_ID.

takes aId string and parses it. A typical LIB_ID string consists of a library nickname followed by a library item name. e.g.: "smt:R_0805", or e.g.: "mylib:R_0805", or e.g.: "ttl:7400"

Parameters
aIdis a string to be parsed into the LIB_ID object.

Definition at line 178 of file lib_id.cpp.

References UTF8::c_str(), Parse(), and THROW_PARSE_ERROR.

179 {
180  int offset = Parse( aId );
181 
182  if( offset != -1 )
183  {
184  THROW_PARSE_ERROR( _( "Illegal character found in LIB_ID string" ),
185  wxString::FromUTF8( aId.c_str() ),
186  aId.c_str(),
187  0,
188  offset );
189  }
190 }
int Parse(const UTF8 &aId)
Function Parse.
Definition: lib_id.cpp:122
#define THROW_PARSE_ERROR(aProblem, aSource, aInputLine, aLineNumber, aByteIndex)
Definition: ki_exception.h:133
const char * c_str() const
Definition: utf8.h:107
LIB_ID::LIB_ID ( const wxString &  aId)

Definition at line 193 of file lib_id.cpp.

References Parse(), and THROW_PARSE_ERROR.

194 {
195  UTF8 id = aId;
196 
197  int offset = Parse( id );
198 
199  if( offset != -1 )
200  {
201  THROW_PARSE_ERROR( _( "Illegal character found in LIB_ID string" ),
202  aId,
203  id.c_str(),
204  0,
205  offset );
206  }
207 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
int Parse(const UTF8 &aId)
Function Parse.
Definition: lib_id.cpp:122
#define THROW_PARSE_ERROR(aProblem, aSource, aInputLine, aLineNumber, aByteIndex)
Definition: ki_exception.h:133
LIB_ID::LIB_ID ( const wxString &  aLibName,
const wxString &  aLibItemName,
const wxString &  aRevision = wxEmptyString 
)

This LIB_ID ctor is a special version which ignores the parsing due to symbol names allowing '/' as a valid character.

This was causing the symbol names to be truncated at the first occurrence of '/' in the symbol name.

Parameters
aLibNameis the library nickname used to look up the library item in the LIB_TABLE.
aLibItemNameis the name of the library item which is not parsed by the standard LIB_ID::Parse() function.
aRevisionis the revision of the library item.

Definition at line 210 of file lib_id.cpp.

211  :
212  nickname( aLibName ),
213  item_name( aLibItemName ),
214  revision( aRevision )
215 {
216 }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220

Member Function Documentation

void LIB_ID::clear ( )

Function clear.

clears the contents of the library nickname, library entry name, and revision strings.

Definition at line 114 of file lib_id.cpp.

References UTF8::clear(), item_name, nickname, and revision.

Referenced by SCH_COMPONENT::Load(), and Parse().

115 {
116  nickname.clear();
117  item_name.clear();
118  revision.clear();
119 }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
void clear()
Definition: utf8.h:113
int LIB_ID::compare ( const LIB_ID aLibId) const

Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname, library entry name, and revision strings respectively.

Parameters
aLibIdis the LIB_ID to compare against.
Returns
-1 if less than aLibId, 1 if greater than aLibId, and 0 if equal to aLibId.

Definition at line 342 of file lib_id.cpp.

References UTF8::compare(), item_name, nickname, and revision.

Referenced by operator<(), operator==(), and operator>().

343 {
344  // Don't bother comparing the same object.
345  if( this == &aLibId )
346  return 0;
347 
348  int retv = nickname.compare( aLibId.nickname );
349 
350  if( retv != 0 )
351  return retv;
352 
353  retv = item_name.compare( aLibId.item_name );
354 
355  if( retv != 0 )
356  return retv;
357 
358  return revision.compare( aLibId.revision );
359 }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
int compare(const std::string &s) const
Definition: utf8.h:116
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
bool LIB_ID::empty ( ) const
inline

Function empty.

Returns
a boolean true value if the LIB_ID is empty. Otherwise return false.

Definition at line 198 of file lib_id.h.

References UTF8::empty(), item_name, nickname, and revision.

Referenced by CVPCB_MAINFRAME::AutomaticFootprintMatching(), CMP_READER::Load(), PCB_EDIT_FRAME::LoadFootprints(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), BOARD_NETLIST_UPDATER::replaceComponent(), BOARD::ReplaceNetlist(), COMPONENT::SetFPID(), CVPCB_MAINFRAME::SetNewPkg(), CVPCB_MAINFRAME::ToFirstNA(), and CVPCB_MAINFRAME::ToPreviousNA().

198 { return nickname.empty() && item_name.empty() && revision.empty(); }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
bool empty() const
Definition: utf8.h:108
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
UTF8 LIB_ID::Format ( ) const

Function Format.

Returns
the fully formatted text of the LIB_ID.

Definition at line 263 of file lib_id.cpp.

References item_name, nickname, revision, and UTF8::size().

Referenced by BOARD_NETLIST_UPDATER::addNewComponent(), CVPCB_MAINFRAME::BuildCmpListBox(), DIALOG_EXCHANGE_MODULE::change_1_Module(), DIALOG_EXCHANGE_MODULE::changeSameFootprints(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel(), CreateDevicesSection(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint(), COMPONENT::Format(), PCB_IO::format(), MODULE::GetMsgPanelInfo(), DIALOG_EXCHANGE_MODULE::init(), PCB_BASE_FRAME::loadFootprint(), PCB_BASE_FRAME::LoadFootprint(), PCB_EDIT_FRAME::LoadFootprints(), PCB_BASE_FRAME::LoadModuleFromLibrary(), DSN::SPECCTRA_DB::makeIMAGE(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), RecreateCmpFile(), CVPCB_MAINFRAME::refreshAfterComponentSearch(), BOARD_NETLIST_UPDATER::replaceComponent(), BOARD::ReplaceNetlist(), CVPCB_MAINFRAME::SetNewPkg(), BOARD_NETLIST_UPDATER::testConnectivity(), and BOARD_NETLIST_UPDATER::UpdateNetlist().

264 {
265  UTF8 ret;
266 
267  if( nickname.size() )
268  {
269  ret += nickname;
270  ret += ':';
271  }
272 
273  ret += item_name;
274 
275  if( revision.size() )
276  {
277  ret += '/';
278  ret += revision;
279  }
280 
281  return ret;
282 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
std::string::size_type size() const
Definition: utf8.h:115
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
UTF8 LIB_ID::Format ( const UTF8 aLibNickname,
const UTF8 aLibItemName,
const UTF8 aRevision = "" 
)
static

Function Format.

Returns
a string in the proper format as an LIB_ID for a combination of aLibNickname, aLibItemName, and aRevision.
Exceptions
PARSE_ERRORif any of the pieces are illegal.

Definition at line 299 of file lib_id.cpp.

References UTF8::c_str(), okLogical(), okRevision(), UTF8::size(), and THROW_PARSE_ERROR.

300 {
301  UTF8 ret;
302  int offset;
303 
304  if( aLogicalLib.size() )
305  {
306  offset = okLogical( aLogicalLib );
307 
308  if( offset != -1 )
309  {
310  THROW_PARSE_ERROR( _( "Illegal character found in logical library name" ),
311  wxString::FromUTF8( aLogicalLib.c_str() ),
312  aLogicalLib.c_str(), 0, offset );
313  }
314 
315  ret += aLogicalLib;
316  ret += ':';
317  }
318 
319  ret += aLibItemName; // TODO: Add validity test.
320 
321  if( aRevision.size() )
322  {
323  offset = okRevision( aRevision );
324 
325  if( offset != -1 )
326  {
327  THROW_PARSE_ERROR( _( "Illegal character found in revision" ),
328  wxString::FromUTF8( aRevision.c_str() ),
329  aRevision.c_str(),
330  0,
331  offset );
332  }
333 
334  ret += '/';
335  ret += aRevision;
336  }
337 
338  return ret;
339 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
static int okLogical(const UTF8 &aField)
Definition: lib_id.cpp:86
std::string::size_type size() const
Definition: utf8.h:115
#define THROW_PARSE_ERROR(aProblem, aSource, aInputLine, aLineNumber, aByteIndex)
Definition: ki_exception.h:133
const char * c_str() const
Definition: utf8.h:107
static int okRevision(const UTF8 &aField)
Definition: lib_id.cpp:94
const UTF8& LIB_ID::GetLibItemName ( ) const
inline

Function GetLibItemName.

Returns
the library item name, i.e. footprintName.

Definition at line 129 of file lib_id.h.

References item_name.

Referenced by SCH_REFERENCE::CompareLibName(), SCH_EDIT_FRAME::CreateArchiveLibrary(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), PCB_EDIT_FRAME::DoGenFootprintsPositionFile(), PCB_EDIT_FRAME::Exchange_Module(), FOOTPRINT_EDIT_FRAME::Export_Module(), PART_LIBS::FindLibPart(), PART_LIBS::FindLibraryAlias(), FP_LIB_TABLE::FootprintLoad(), FP_LIB_TABLE::FootprintLoadWithOptionalNickname(), PCB_IO::FootprintSave(), FP_LIB_TABLE::FootprintSave(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_LIST::GetModuleInfo(), guessNickname(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), PCB_EDIT_FRAME::LoadFootprints(), LEGACY_PLUGIN::loadMODULE(), LEGACY_PLUGIN::loadMODULE_EDGE(), LEGACY_PLUGIN::loadPAD(), SYMBOL_LIB_TABLE::LoadSymbol(), SYMBOL_LIB_TABLE::LoadSymbolWithOptionalNickname(), NETLIST_EXPORTER_GENERIC::makeComponents(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), CVPCB_MAINFRAME::ReadSchematicNetlist(), PCB_EDIT_FRAME::RecreateBOMFileFromBoard(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), BOARD::ReplaceNetlist(), SCH_COMPONENT::Save(), SCH_LEGACY_PLUGIN::saveComponent(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), SYMBOL_LIB_TABLE::SaveSymbol(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), and SCH_COMPONENT::SetLibId().

129 { return item_name; }
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 LIB_ID::GetLibItemNameAndRev ( ) const

Definition at line 285 of file lib_id.cpp.

References revision, and UTF8::size().

286 {
287  UTF8 ret;
288 
289  if( revision.size() )
290  {
291  ret += '/';
292  ret += revision;
293  }
294 
295  return ret;
296 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
std::string::size_type size() const
Definition: utf8.h:115
const UTF8& LIB_ID::GetRevision ( ) const
inline

Definition at line 144 of file lib_id.h.

References revision.

144 { return revision; }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
bool LIB_ID::IsLegacy ( ) const
inline

Function IsLegacy.

Returns
true if the LIB_ID only has the item_name name defined.

Definition at line 184 of file lib_id.h.

References UTF8::empty(), item_name, nickname, and revision.

Referenced by CVPCB_MAINFRAME::ReadNetListAndFpFiles().

184 { return nickname.empty() && !item_name.empty() && revision.empty(); }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
bool empty() const
Definition: utf8.h:108
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
bool LIB_ID::IsValid ( ) const
inline

Function IsValid.

Returns
true is the LIB_ID is valid.

A valid LIB_ID must have both the library nickname and the library item name defined. The revision field is optional.

Note
A return value of true does not indicated that the LIB_ID is a valid LIB_TABLE entry.

Definition at line 177 of file lib_id.h.

References UTF8::empty(), item_name, and nickname.

Referenced by PCB_EDIT_FRAME::LoadFootprints().

177 { return !nickname.empty() && !item_name.empty(); }
bool empty() const
Definition: utf8.h:108
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
bool LIB_ID::operator!= ( const LIB_ID aLibId) const
inline

Definition at line 213 of file lib_id.h.

213 { return !(*this == aLibId); }
bool LIB_ID::operator< ( const LIB_ID aLibId) const
inline

Definition at line 210 of file lib_id.h.

References compare().

210 { return this->compare( aLibId ) < 0; }
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
Definition: lib_id.cpp:342
bool LIB_ID::operator== ( const LIB_ID aLibId) const
inline

Definition at line 212 of file lib_id.h.

References compare().

212 { return this->compare( aLibId ) == 0; }
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
Definition: lib_id.cpp:342
bool LIB_ID::operator> ( const LIB_ID aLibId) const
inline

Definition at line 211 of file lib_id.h.

References compare().

211 { return this->compare( aLibId ) > 0; }
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
Definition: lib_id.cpp:342
int LIB_ID::Parse ( const UTF8 aId)

Function Parse.

[re-]stuffs this LIB_ID with the information from aId.

Parameters
aIdis the string to populate the LIB_ID object.
Returns
int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset into aId at which an error was detected.

Definition at line 122 of file lib_id.cpp.

References UTF8::c_str(), clear(), EndsWithRev(), UTF8::find(), UTF8::length(), UTF8::npos, ReplaceIllegalFileNameChars(), revision, SetLibItemName(), SetLibNickname(), UTF8::size(), and UTF8::substr().

Referenced by DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_LIST::GetModuleInfo(), LIB_ID(), CMP_READER::Load(), PCB_BASE_FRAME::LoadModuleFromLibrary(), KICAD_NETLIST_PARSER::parseComponent(), PCB_PARSER::parseMODULE_unchecked(), and CVPCB_MAINFRAME::SetNewPkg().

123 {
124  clear();
125 
126  const char* buffer = aId.c_str();
127  const char* rev = EndsWithRev( buffer, buffer+aId.length(), '/' );
128  size_t revNdx;
129  size_t partNdx;
130  int offset;
131 
132  //=====<revision>=========================================
133  // in a LIB_ID like discret:R3/rev4
134  if( rev )
135  {
136  revNdx = rev - buffer;
137 
138  // no need to check revision, EndsWithRev did that.
139  revision = aId.substr( revNdx );
140  --revNdx; // back up to omit the '/' which precedes the rev
141  }
142  else
143  {
144  revNdx = aId.size();
145  }
146 
147  //=====<nickname>==========================================
148  if( ( partNdx = aId.find( ':' ) ) != aId.npos )
149  {
150  offset = SetLibNickname( aId.substr( 0, partNdx ) );
151 
152  if( offset > -1 )
153  {
154  return offset;
155  }
156 
157  ++partNdx; // skip ':'
158  }
159  else
160  {
161  partNdx = 0;
162  }
163 
164  //=====<item name>====================================
165  if( partNdx >= revNdx )
166  return partNdx; // Error: no library item name.
167 
168  // Be sure the item name is valid.
169  // Some chars can be found in legacy files converted files from an other EDA tools.
170  std::string fpname = aId.substr( partNdx, revNdx-partNdx );
171  ReplaceIllegalFileNameChars( &fpname, '_' );
172  SetLibItemName( UTF8( fpname ) );
173 
174  return -1;
175 }
Class UTF8 is an 8 bit string that is assuredly encoded in UTF8, and supplies special conversion supp...
Definition: utf8.h:73
const char * EndsWithRev(const char *start, const char *tail, char separator)
Definition: lib_id.cpp:41
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
std::string substr(size_t pos=0, size_t len=npos) const
Definition: utf8.h:175
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar)
Function ReplaceIllegalFileNameChars checks aName for illegal file name characters.
Definition: string.cpp:483
std::string::size_type size() const
Definition: utf8.h:115
std::string::size_type find(char c) const
Definition: utf8.h:110
std::string::size_type length() const
Definition: utf8.h:114
void clear()
Function clear.
Definition: lib_id.cpp:114
int SetLibItemName(const UTF8 &aLibItemName, bool aTestForRev=true)
Function SetLibItemName.
Definition: lib_id.cpp:232
int SetLibNickname(const UTF8 &aNickname)
Function SetLibNickname.
Definition: lib_id.cpp:219
static const std::string::size_type npos
Definition: utf8.h:148
const char * c_str() const
Definition: utf8.h:107
int LIB_ID::SetLibItemName ( const UTF8 aLibItemName,
bool  aTestForRev = true 
)

Function SetLibItemName.

overrides the library item name portion of the LIB_ID to aLibItemName

Returns
int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset into the parameter at which an error was detected, usually because it contained '/'.

Definition at line 232 of file lib_id.cpp.

References UTF8::find_first_of(), item_name, and UTF8::substr().

Referenced by FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint(), SCH_COMPONENT::Load(), SCH_EDIT_FRAME::Load_Component(), LEGACY_NETLIST_READER::loadComponent(), Parse(), RESCUE_CASE_CANDIDATE::PerformAction(), RESCUE_CACHE_CANDIDATE::PerformAction(), SCH_COMPONENT::SCH_COMPONENT(), DIALOG_MODULE_MODULE_EDITOR::TransferDataFromWindow(), and RESCUER::UndoRescues().

233 {
234  int separation = int( aLibItemName.find_first_of( "/" ) );
235 
236  if( aTestForRev && separation != -1 )
237  {
238  item_name = aLibItemName.substr( 0, separation-1 );
239  return separation;
240  }
241  else
242  {
243  item_name = aLibItemName;
244  }
245 
246  return -1;
247 }
std::string substr(size_t pos=0, size_t len=npos) const
Definition: utf8.h:175
std::string::size_type find_first_of(const std::string &str, std::string::size_type pos=0) const
Definition: utf8.h:122
UTF8 item_name
The name of the entry in the logical library.
Definition: lib_id.h:221
int LIB_ID::SetLibNickname ( const UTF8 aNickname)

Function SetLibNickname.

overrides the logical library name portion of the LIB_ID to aNickname.

Returns
int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset into the parameter at which an error was detected, usually because it contained '/' or ':'.

Definition at line 219 of file lib_id.cpp.

References nickname, and okLogical().

Referenced by FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), EVT_TOOL(), FOOTPRINT_VIEWER_FRAME::ExportSelectedFootprint(), FP_LIB_TABLE::FootprintLoad(), guessNickname(), Parse(), and DIALOG_SYMBOL_REMAP::remapSymbolToLibTable().

220 {
221  int offset = okLogical( aLogical );
222 
223  if( offset == -1 )
224  {
225  nickname = aLogical;
226  }
227 
228  return offset;
229 }
static int okLogical(const UTF8 &aField)
Definition: lib_id.cpp:86
UTF8 nickname
The nickname of the library or empty.
Definition: lib_id.h:220
int LIB_ID::SetRevision ( const UTF8 aRevision)

Definition at line 250 of file lib_id.cpp.

References okRevision(), and revision.

251 {
252  int offset = okRevision( aRevision );
253 
254  if( offset == -1 )
255  {
256  revision = aRevision;
257  }
258 
259  return offset;
260 }
UTF8 revision
The revision of the entry.
Definition: lib_id.h:222
static int okRevision(const UTF8 &aField)
Definition: lib_id.cpp:94

Member Data Documentation

UTF8 LIB_ID::item_name
protected

The name of the entry in the logical library.

Definition at line 221 of file lib_id.h.

Referenced by clear(), compare(), empty(), Format(), GetLibItemName(), IsLegacy(), IsValid(), and SetLibItemName().

UTF8 LIB_ID::nickname
protected

The nickname of the library or empty.

Definition at line 220 of file lib_id.h.

Referenced by clear(), compare(), empty(), Format(), GetLibNickname(), IsLegacy(), IsValid(), and SetLibNickname().

UTF8 LIB_ID::revision
protected

The revision of the entry.

Definition at line 222 of file lib_id.h.

Referenced by clear(), compare(), empty(), Format(), GetLibItemNameAndRev(), GetRevision(), IsLegacy(), Parse(), and SetRevision().


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