40#include <wx/tokenzr.h>
44 const wxString& aFootprintName )
46 if( aFootprintName.IsEmpty() )
49 for( std::unique_ptr<FOOTPRINT_INFO>& fp :
m_list )
51 if( aLibNickname == fp->GetLibNickname() && aFootprintName == fp->GetFootprintName() )
61 if( aFootprintName.IsEmpty() )
66 wxCHECK_MSG( fpid.
Parse( aFootprintName ) < 0,
nullptr,
67 wxString::Format( wxT(
"'%s' is not a valid LIB_ID." ), aFootprintName ) );
75 std::vector<SEARCH_TERM> terms;
79 wxStringTokenizer keywordTokenizer(
GetKeywords(), wxS(
" " ), wxTOKEN_STRTOK );
81 while( keywordTokenizer.HasMoreTokens() )
82 terms.emplace_back(
SEARCH_TERM( keywordTokenizer.GetNextToken(), 4 ) );
121 dlg.
MessageSet(
_(
"Errors were encountered loading footprints:" ) );
125 while( std::unique_ptr<IO_ERROR> error =
PopError() )
127 wxString tmp =
EscapeHTML( error->Problem() );
130 tmp.Replace( wxS(
"\n" ), wxS(
"<BR>" ) );
131 msg += wxT(
"<p>" ) + tmp + wxT(
"</p>" );
173 return footprintInfo;
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
void MessageSet(const wxString &message)
Add a message (in bold) to message list.
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
virtual void * IfaceOrAddress(int aDataId) override=0
Return pointer to the requested object.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
virtual const wxString GetProjectPath() const
Return the full path of the project.
@ KIFACE_FOOTPRINT_LIST
Return a pointer to the global instance of FOOTPRINT_LIST from pcbnew.
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Implement a participant in the KIWAY alchemy.
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)