20#ifndef IMPORT_PROJ_PROPERTIES_H
21#define IMPORT_PROJ_PROPERTIES_H
59inline wxString
JoinList(
const wxArrayString& aItems )
65inline std::vector<wxString>
SplitList(
const wxString& aValue )
67 std::vector<wxString> out;
69 for(
const wxString& item : wxSplit( aValue,
LIST_SEPARATOR,
'\0' ) )
72 out.push_back( item );
79inline void ReadFootprintProps(
const std::map<std::string, UTF8>* aProps, wxString& aCacheNickname,
80 std::vector<wxString>& aSourceFpLibs )
86 aCacheNickname = it->second.wx_str();
88 if(
auto it = aProps->find(
SOURCE_FP_LIBS ); it != aProps->end() )
89 aSourceFpLibs =
SplitList( it->second.wx_str() );
93inline void ReadSymbolProps(
const std::map<std::string, UTF8>* aProps, wxString& aCacheNickname,
94 std::vector<wxString>& aSourceSymLibs )
100 aCacheNickname = it->second.wx_str();
103 aSourceSymLibs =
SplitList( it->second.wx_str() );
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, bool aLib)
Replace illegal LIB_ID item name characters with underscores '_'.
Property keys and codec threaded through IMPORT_PROJ_HELPER::m_properties to coordinate a non-KiCad p...
void ReadSymbolProps(const std::map< std::string, UTF8 > *aProps, wxString &aCacheNickname, std::vector< wxString > &aSourceSymLibs)
Read the symbol-import coordination properties out of a properties map.
wxString ManagedCacheOption()
Options string identifying a library-table row as a generated import cache.
constexpr char SOURCE_FP_LIBS[]
constexpr char MANAGED_CACHE_KEY[]
Library-table row option key marking a row as a generated import cache.
constexpr char SYM_CACHE_NICKNAME[]
constexpr char FP_CACHE_NICKNAME[]
wxString JoinList(const wxArrayString &aItems)
Encode library nicknames into a single list-property value.
wxString MakeCacheNickname(const wxString &aStem)
Derive the generated footprint-cache nickname from a project or file stem.
wxString MakeSymbolCacheNickname(const wxString &aStem)
Derive the generated symbol-cache nickname from a project or file stem.
constexpr char LIST_SEPARATOR
Separator joining a list value within a single property.
std::vector< wxString > SplitList(const wxString &aValue)
Decode a list-property value back into nicknames, dropping empties.
constexpr char SOURCE_SYM_LIBS[]
void ReadFootprintProps(const std::map< std::string, UTF8 > *aProps, wxString &aCacheNickname, std::vector< wxString > &aSourceFpLibs)
Read the footprint-import coordination properties out of a properties map.