22#include <wx/tokenzr.h>
35 wxStringTokenizer keywordTokenizer(
GetKeywords(), wxS(
" " ), wxTOKEN_STRTOK );
37 while( keywordTokenizer.HasMoreTokens() )
53 DesignBlock& def = aDesignBlock;
64 types::CustomProperty* field = def.mutable_fields()->Add();
65 field->set_key(
name.ToUTF8() );
66 field->set_value( value.ToUTF8() );
73 kiapi::common::types::DesignBlock designBlock;
76 if( !aContainer.PackFrom( designBlock ) )
77 wxFAIL_MSG( wxT(
"Failed to pack DESIGN_BLOCK" ) );
86 const DesignBlock& def = aDesignBlock;
97 for(
const types::CustomProperty& prop : def.fields() )
98 m_fields[wxString::FromUTF8( prop.key() )] = wxString::FromUTF8( prop.value() );
106 kiapi::common::types::DesignBlock designBlock;
108 if( !aContainer.UnpackTo( &designBlock ) )
wxString m_schematicFile
File name and path for schematic file.
wxString GetLibNickname() const override
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
std::vector< SEARCH_TERM > & GetSearchTerms() override
wxString GetDesc() override
LIB_ID GetLIB_ID() const override
const wxString & GetKeywords() const
wxString m_keywords
Search keywords to find design block in library.
wxString m_libDescription
File name and path for documentation file.
std::vector< SEARCH_TERM > m_searchTerms
nlohmann::ordered_map< wxString, wxString > m_fields
wxString m_boardFile
File name and path for board file.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
wxString GetName() const override
KICOMMON_API void PackLibId(types::LibraryIdentifier *aOutput, const LIB_ID &aId)
KICOMMON_API LIB_ID UnpackLibId(const types::LibraryIdentifier &aId)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
A structure for storing weighted search terms.