38#include <wx/tokenzr.h>
42 const wxString& aDesignBlockName )
44 if( aDesignBlockName.IsEmpty() )
47 for( std::unique_ptr<DESIGN_BLOCK_INFO>& db :
m_list )
49 if( aLibNickname == db->GetLibNickname() && aDesignBlockName == db->GetDesignBlockName() )
59 if( aDesignBlockName.IsEmpty() )
64 wxCHECK_MSG( dbid.
Parse( aDesignBlockName ) < 0,
nullptr,
65 wxString::Format( wxT(
"'%s' is not a valid LIB_ID." ), aDesignBlockName ) );
73 std::vector<SEARCH_TERM> terms;
77 wxStringTokenizer keywordTokenizer(
GetKeywords(), wxS(
" " ), wxTOKEN_STRTOK );
79 while( keywordTokenizer.HasMoreTokens() )
80 terms.emplace_back(
SEARCH_TERM( keywordTokenizer.GetNextToken(), 4 ) );
wxString m_nickname
library as known in DESIGN_BLOCK_LIB_TABLE
bool InLibrary(const wxString &aLibrary) const
Test if the DESIGN_BLOCK_INFO object was loaded from aLibrary.
wxString m_dbname
Module name.
wxString GetDesc() override
std::vector< SEARCH_TERM > GetSearchTerms() override
wxString GetName() const override
DESIGN_BLOCK_INFO * GetDesignBlockInfo(const wxString &aDesignBlockName)
Get info for a design block by id.
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.
bool operator<(const DESIGN_BLOCK_INFO &lhs, const DESIGN_BLOCK_INFO &rhs)
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.