35#include <wx/tokenzr.h>
38 const wxString& aFootprintName )
40 if( aFootprintName.IsEmpty() )
43 for( std::unique_ptr<FOOTPRINT_INFO>& fp :
m_list )
45 if( aLibNickname == fp->GetLibNickname() && aFootprintName == fp->GetFootprintName() )
55 if( aFootprintName.IsEmpty() )
60 wxCHECK_MSG( fpid.
Parse( aFootprintName ) < 0,
nullptr,
61 wxString::Format( wxT(
"'%s' is not a valid LIB_ID." ), aFootprintName ) );
69 std::vector<SEARCH_TERM> terms;
75 wxStringTokenizer keywordTokenizer(
GetKeywords(),
" \t\r\n", wxTOKEN_STRTOK );
77 while( keywordTokenizer.HasMoreTokens() )
78 terms.emplace_back(
SEARCH_TERM( keywordTokenizer.GetNextToken(), 4 ) );
117 dlg.
MessageSet(
_(
"Errors were encountered loading footprints:" ) );
121 while( std::unique_ptr<IO_ERROR> error =
PopError() )
123 wxString tmp =
EscapeHTML( error->Problem() );
126 tmp.Replace( wxS(
"\n" ), wxS(
"<BR>" ) );
127 msg += wxT(
"<p>" ) + tmp + wxT(
"</p>" );
140 while( std::unique_ptr<IO_ERROR> error =
PopError() )
142 if( !messages.IsEmpty() )
143 messages += wxS(
"\n" );
145 messages += error->Problem();
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.
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.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
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.
A structure for storing weighted search terms.