Rename PROPERTIES to STRING_UTF8_MAP for clarity

This class has nothing to do with the properties system
This commit is contained in:
Jon Evans 2022-11-06 11:51:52 -05:00
parent 68de92313e
commit dd94b2d3a7
54 changed files with 273 additions and 270 deletions

View File

@ -361,7 +361,6 @@ set( COMMON_SRCS
paths.cpp paths.cpp
printout.cpp printout.cpp
project.cpp project.cpp
properties.cpp
ptree.cpp ptree.cpp
rc_item.cpp rc_item.cpp
refdes_utils.cpp refdes_utils.cpp
@ -372,6 +371,7 @@ set( COMMON_SRCS
search_stack.cpp search_stack.cpp
searchhelpfilefullpath.cpp searchhelpfilefullpath.cpp
status_popup.cpp status_popup.cpp
string_utf8_map.cpp
stroke_params.cpp stroke_params.cpp
systemdirsappend.cpp systemdirsappend.cpp
template_fieldnames.cpp template_fieldnames.cpp

View File

@ -45,7 +45,7 @@ LIB_TABLE_ROW* new_clone( const LIB_TABLE_ROW& aRow )
} }
void LIB_TABLE_ROW::setProperties( PROPERTIES* aProperties ) void LIB_TABLE_ROW::setProperties( STRING_UTF8_MAP* aProperties )
{ {
properties.reset( aProperties ); properties.reset( aProperties );
} }
@ -355,14 +355,14 @@ void LIB_TABLE::Save( const wxString& aFileName ) const
} }
PROPERTIES* LIB_TABLE::ParseOptions( const std::string& aOptionsList ) STRING_UTF8_MAP* LIB_TABLE::ParseOptions( const std::string& aOptionsList )
{ {
if( aOptionsList.size() ) if( aOptionsList.size() )
{ {
const char* cp = &aOptionsList[0]; const char* cp = &aOptionsList[0];
const char* end = cp + aOptionsList.size(); const char* end = cp + aOptionsList.size();
PROPERTIES props; STRING_UTF8_MAP props;
std::string pair; std::string pair;
// Parse all name=value pairs // Parse all name=value pairs
@ -413,20 +413,20 @@ PROPERTIES* LIB_TABLE::ParseOptions( const std::string& aOptionsList )
} }
if( props.size() ) if( props.size() )
return new PROPERTIES( props ); return new STRING_UTF8_MAP( props );
} }
return nullptr; return nullptr;
} }
UTF8 LIB_TABLE::FormatOptions( const PROPERTIES* aProperties ) UTF8 LIB_TABLE::FormatOptions( const STRING_UTF8_MAP* aProperties )
{ {
UTF8 ret; UTF8 ret;
if( aProperties ) if( aProperties )
{ {
for( PROPERTIES::const_iterator it = aProperties->begin(); it != aProperties->end(); ++it ) for( STRING_UTF8_MAP::const_iterator it = aProperties->begin(); it != aProperties->end(); ++it )
{ {
const std::string& name = it->first; const std::string& name = it->first;

View File

@ -18,12 +18,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <properties.h> #include <string_utf8_map.h>
bool PROPERTIES::Value( const char* aName, UTF8* aFetchedValue ) const bool STRING_UTF8_MAP::Value( const char* aName, UTF8* aFetchedValue ) const
{ {
PROPERTIES::const_iterator it = find( aName ); STRING_UTF8_MAP::const_iterator it = find( aName );
if( it != end() ) if( it != end() )
{ {

View File

@ -793,7 +793,7 @@ SYMBOL_LIB_TABLE_RESCUER::SYMBOL_LIB_TABLE_RESCUER( PROJECT& aProject, SCHEMATIC
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType ) : EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType ) :
RESCUER( aProject, aSchematic, aCurrentSheet, aGalBackEndType ) RESCUER( aProject, aSchematic, aCurrentSheet, aGalBackEndType )
{ {
m_properties = std::make_unique<PROPERTIES>(); m_properties = std::make_unique<STRING_UTF8_MAP>();
} }

View File

@ -41,7 +41,7 @@
#include <wx/string.h> #include <wx/string.h>
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <properties.h> #include <string_utf8_map.h>
#include <lib_symbol.h> #include <lib_symbol.h>
#include <sch_plugins/legacy/sch_legacy_plugin.h> #include <sch_plugins/legacy/sch_legacy_plugin.h>
#include <class_draw_panel_gal.h> #include <class_draw_panel_gal.h>
@ -381,7 +381,7 @@ public:
private: private:
std::vector<std::unique_ptr<LIB_SYMBOL>> m_rescueLibSymbols; std::vector<std::unique_ptr<LIB_SYMBOL>> m_rescueLibSymbols;
std::unique_ptr< PROPERTIES > m_properties; ///< Library plugin properties. std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
}; };
#endif // _LIB_CACHE_RESCUE_H_ #endif // _LIB_CACHE_RESCUE_H_

View File

@ -38,7 +38,7 @@ class SYMBOL_LIB_TABLE;
class KIWAY; class KIWAY;
class LIB_SYMBOL; class LIB_SYMBOL;
class SYMBOL_LIB; class SYMBOL_LIB;
class PROPERTIES; class STRING_UTF8_MAP;
class PROGRESS_REPORTER; class PROGRESS_REPORTER;
@ -193,7 +193,7 @@ public:
*/ */
virtual int GetModifyHash() const = 0; virtual int GetModifyHash() const = 0;
virtual void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = nullptr ); virtual void SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Load information from some input file format that this #SCH_PLUGIN implementation * Load information from some input file format that this #SCH_PLUGIN implementation
@ -225,7 +225,7 @@ public:
*/ */
virtual SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic, virtual SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr, SCH_SHEET* aAppendToMe = nullptr,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Write \a aSchematic to a storage file in a format that this #SCH_PLUGIN implementation * Write \a aSchematic to a storage file in a format that this #SCH_PLUGIN implementation
@ -253,7 +253,7 @@ public:
* @throw IO_ERROR if there is a problem saving or exporting. * @throw IO_ERROR if there is a problem saving or exporting.
*/ */
virtual void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic, virtual void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Populate a list of #LIB_SYMBOL alias names contained within the library \a aLibraryPath. * Populate a list of #LIB_SYMBOL alias names contained within the library \a aLibraryPath.
@ -272,7 +272,7 @@ public:
* @throw IO_ERROR if the library cannot be found, the part library cannot be loaded. * @throw IO_ERROR if the library cannot be found, the part library cannot be loaded.
*/ */
virtual void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath, virtual void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Populate a list of #LIB_SYMBOL aliases contained within the library \a aLibraryPath. * Populate a list of #LIB_SYMBOL aliases contained within the library \a aLibraryPath.
@ -295,7 +295,7 @@ public:
*/ */
virtual void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, virtual void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Load a #LIB_SYMBOL object having \a aPartName from the \a aLibraryPath containing * Load a #LIB_SYMBOL object having \a aPartName from the \a aLibraryPath containing
@ -319,7 +319,7 @@ public:
* is thrown in the case where aAliasName cannot be found. * is thrown in the case where aAliasName cannot be found.
*/ */
virtual LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aPartName, virtual LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aPartName,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Write \a aSymbol to an existing library located at \a aLibraryPath. If a #LIB_SYMBOL * Write \a aSymbol to an existing library located at \a aLibraryPath. If a #LIB_SYMBOL
@ -343,7 +343,7 @@ public:
* @throw IO_ERROR if there is a problem saving. * @throw IO_ERROR if there is a problem saving.
*/ */
virtual void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol, virtual void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Delete the entire #LIB_SYMBOL associated with \a aAliasName from the library * Delete the entire #LIB_SYMBOL associated with \a aAliasName from the library
@ -364,7 +364,7 @@ public:
* @throw IO_ERROR if there is a problem finding the alias or the library or deleting it. * @throw IO_ERROR if there is a problem finding the alias or the library or deleting it.
*/ */
virtual void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, virtual void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Create a new empty symbol library at \a aLibraryPath. It is an error to attempt * Create a new empty symbol library at \a aLibraryPath. It is an error to attempt
@ -382,7 +382,7 @@ public:
* @throw IO_ERROR if there is a problem finding the library, or creating it. * @throw IO_ERROR if there is a problem finding the library, or creating it.
*/ */
virtual void CreateSymbolLib( const wxString& aLibraryPath, virtual void CreateSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Delete an existing symbol library and returns true if successful, or if library * Delete an existing symbol library and returns true if successful, or if library
@ -404,7 +404,7 @@ public:
* @throw IO_ERROR if there is a problem deleting an existing library. * @throw IO_ERROR if there is a problem deleting an existing library.
*/ */
virtual bool DeleteSymbolLib( const wxString& aLibraryPath, virtual bool DeleteSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Return true if the library at \a aLibraryPath is writable. (Often * Return true if the library at \a aLibraryPath is writable. (Often
@ -441,7 +441,7 @@ public:
* This would require a 3 column list, and introducing wx GUI knowledge to * This would require a 3 column list, and introducing wx GUI knowledge to
* #SCH_PLUGIN, which has been avoided to date. * #SCH_PLUGIN, which has been avoided to date.
*/ */
virtual void SymbolLibOptions( PROPERTIES* aListToAppendTo ) const; virtual void SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const;
/** /**
* @return true if this plugin supports libraries that contain sub-libraries. * @return true if this plugin supports libraries that contain sub-libraries.

View File

@ -20,7 +20,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>. * with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <properties.h> #include <string_utf8_map.h>
#include <sch_io_mgr.h> #include <sch_io_mgr.h>
#include <wx/translation.h> #include <wx/translation.h>
@ -42,14 +42,14 @@ static void not_implemented( const SCH_PLUGIN* aPlugin, const char* aCaller )
} }
void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties ) void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
{ {
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
} }
SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
{ {
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
return nullptr; return nullptr;
@ -57,7 +57,7 @@ SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
void SCH_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic, void SCH_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -66,7 +66,7 @@ void SCH_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC*
void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList, void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -75,7 +75,7 @@ void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList,
void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -83,7 +83,7 @@ void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -92,7 +92,7 @@ LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString
void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol, void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -100,21 +100,21 @@ void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSy
void SCH_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, void SCH_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
} }
void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const PROPERTIES* aProperties ) void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
} }
bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const PROPERTIES* aProperties ) bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -130,7 +130,7 @@ bool SCH_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
} }
void SCH_PLUGIN::SymbolLibOptions( PROPERTIES* aListToAppendTo ) const void SCH_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
{ {
// disable all these in another couple of months, after everyone has seen them: // disable all these in another couple of months, after everyone has seen them:
#if 1 #if 1

View File

@ -220,7 +220,7 @@ wxFileName SCH_ALTIUM_PLUGIN::getLibFileName()
SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
{ {
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr ); wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );

View File

@ -63,7 +63,7 @@ public:
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr, SCH_SHEET* aAppendToMe = nullptr,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool CheckHeader( const wxString& aFileName ) override; bool CheckHeader( const wxString& aFileName ) override;
@ -160,7 +160,7 @@ private:
wxString m_libName; // Library name to save symbols wxString m_libName; // Library name to save symbols
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; // Plugin to create KiCad symbol library. SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; // Plugin to create KiCad symbol library.
std::unique_ptr<PROPERTIES> m_properties; // Library plugin properties. std::unique_ptr<STRING_UTF8_MAP> m_properties; // Library plugin properties.
std::unique_ptr<TITLE_BLOCK> m_currentTitleBlock; // Will be assigned at the end of parsing std::unique_ptr<TITLE_BLOCK> m_currentTitleBlock; // Will be assigned at the end of parsing
// a sheet // a sheet

View File

@ -27,7 +27,7 @@
#include <sch_plugins/cadstar/cadstar_sch_archive_loader.h> #include <sch_plugins/cadstar/cadstar_sch_archive_loader.h>
#include <sch_plugins/cadstar/cadstar_sch_archive_plugin.h> #include <sch_plugins/cadstar/cadstar_sch_archive_plugin.h>
#include <properties.h> #include <string_utf8_map.h>
#include <sch_screen.h> #include <sch_screen.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <schematic.h> #include <schematic.h>
@ -59,7 +59,7 @@ int CADSTAR_SCH_ARCHIVE_PLUGIN::GetModifyHash() const
SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
{ {
wxASSERT( !aFileName || aSchematic != NULL ); wxASSERT( !aFileName || aSchematic != NULL );

View File

@ -55,7 +55,7 @@ public:
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr, SCH_SHEET* aAppendToMe = nullptr,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool CheckHeader( const wxString& aFileName ) override; bool CheckHeader( const wxString& aFileName ) override;

View File

@ -46,7 +46,7 @@ SCH_DATABASE_PLUGIN::~SCH_DATABASE_PLUGIN()
void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList, void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
std::vector<LIB_SYMBOL*> symbols; std::vector<LIB_SYMBOL*> symbols;
EnumerateSymbolLib( symbols, aLibraryPath, aProperties ); EnumerateSymbolLib( symbols, aLibraryPath, aProperties );
@ -58,7 +58,7 @@ void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxCHECK_RET( m_libTable, "Database plugin missing library table handle!" ); wxCHECK_RET( m_libTable, "Database plugin missing library table handle!" );
ensureSettings( aLibraryPath ); ensureSettings( aLibraryPath );
@ -103,7 +103,7 @@ void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolL
LIB_SYMBOL* SCH_DATABASE_PLUGIN::LoadSymbol( const wxString& aLibraryPath, LIB_SYMBOL* SCH_DATABASE_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName, const wxString& aAliasName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxCHECK( m_libTable, nullptr ); wxCHECK( m_libTable, nullptr );
ensureSettings( aLibraryPath ); ensureSettings( aLibraryPath );

View File

@ -64,14 +64,14 @@ public:
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName, LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool SupportsSubLibraries() const override { return true; } bool SupportsSubLibraries() const override { return true; }

View File

@ -25,7 +25,7 @@
#include <sch_plugins/eagle/sch_eagle_plugin.h> #include <sch_plugins/eagle/sch_eagle_plugin.h>
#include <locale_io.h> #include <locale_io.h>
#include <properties.h> #include <string_utf8_map.h>
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
@ -427,7 +427,7 @@ void SCH_EAGLE_PLUGIN::checkpoint()
SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
{ {
wxASSERT( !aFileName || aSchematic != nullptr ); wxASSERT( !aFileName || aSchematic != nullptr );
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -485,7 +485,7 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
wxCHECK_MSG( libTable, nullptr, wxT( "Could not load symbol lib table." ) ); wxCHECK_MSG( libTable, nullptr, wxT( "Could not load symbol lib table." ) );
m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) ); m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
m_properties = std::make_unique<PROPERTIES>(); m_properties = std::make_unique<STRING_UTF8_MAP>();
( *m_properties )[SCH_LEGACY_PLUGIN::PropBuffering] = ""; ( *m_properties )[SCH_LEGACY_PLUGIN::PropBuffering] = "";
/// @note No check is being done here to see if the existing symbol library exists so this /// @note No check is being done here to see if the existing symbol library exists so this

View File

@ -47,7 +47,7 @@ class SCH_TEXT;
class SCH_GLOBALLABEL; class SCH_GLOBALLABEL;
class SCH_SYMBOL; class SCH_SYMBOL;
class SCH_FIELD; class SCH_FIELD;
class PROPERTIES; class STRING_UTF8_MAP;
class SCH_EAGLE_PLUGIN_CACHE; class SCH_EAGLE_PLUGIN_CACHE;
class LIB_SYMBOL; class LIB_SYMBOL;
class SYMBOL_LIB; class SYMBOL_LIB;
@ -100,7 +100,7 @@ public:
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr, SCH_SHEET* aAppendToMe = nullptr,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool CheckHeader( const wxString& aFileName ) override; bool CheckHeader( const wxString& aFileName ) override;
@ -228,7 +228,7 @@ private:
std::map<wxString, EAGLE_LIBRARY> m_eagleLibs; std::map<wxString, EAGLE_LIBRARY> m_eagleLibs;
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; ///< PI to create KiCad symbol library. SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; ///< PI to create KiCad symbol library.
std::unique_ptr< PROPERTIES > m_properties; ///< Library plugin properties. std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr
unsigned m_doneCount; unsigned m_doneCount;

View File

@ -85,7 +85,7 @@ SCH_SEXPR_PLUGIN::~SCH_SEXPR_PLUGIN()
} }
void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties ) void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
{ {
m_version = 0; m_version = 0;
m_appending = false; m_appending = false;
@ -98,7 +98,7 @@ void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const PROPERTIES* aPropertie
SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
{ {
wxASSERT( !aFileName || aSchematic != nullptr ); wxASSERT( !aFileName || aSchematic != nullptr );
@ -319,7 +319,7 @@ void SCH_SEXPR_PLUGIN::LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet, int
void SCH_SEXPR_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic, void SCH_SEXPR_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." ); wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." ); wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
@ -1297,7 +1297,7 @@ void SCH_SEXPR_PLUGIN::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aSh
} }
void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties ) void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
{ {
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() ) if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{ {
@ -1311,7 +1311,7 @@ void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPERT
} }
bool SCH_SEXPR_PLUGIN::isBuffering( const PROPERTIES* aProperties ) bool SCH_SEXPR_PLUGIN::isBuffering( const STRING_UTF8_MAP* aProperties )
{ {
return ( aProperties && aProperties->Exists( SCH_SEXPR_PLUGIN::PropBuffering ) ); return ( aProperties && aProperties->Exists( SCH_SEXPR_PLUGIN::PropBuffering ) );
} }
@ -1329,7 +1329,7 @@ int SCH_SEXPR_PLUGIN::GetModifyHash() const
void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList, void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1350,7 +1350,7 @@ void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1370,7 +1370,7 @@ void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList
LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1386,7 +1386,7 @@ LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wx
void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol, void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1400,7 +1400,7 @@ void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBO
void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1414,7 +1414,7 @@ void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxStrin
void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
if( wxFileExists( aLibraryPath ) ) if( wxFileExists( aLibraryPath ) )
{ {
@ -1433,7 +1433,7 @@ void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxFileName fn = aLibraryPath; wxFileName fn = aLibraryPath;
@ -1458,7 +1458,7 @@ bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
} }
void SCH_SEXPR_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const PROPERTIES* aProperties ) void SCH_SEXPR_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
if( !m_cache ) if( !m_cache )
m_cache = new SCH_SEXPR_PLUGIN_CACHE( aLibraryPath ); m_cache = new SCH_SEXPR_PLUGIN_CACHE( aLibraryPath );

View File

@ -46,7 +46,7 @@ class SCH_TEXTBOX;
class SCH_SYMBOL; class SCH_SYMBOL;
class SCH_FIELD; class SCH_FIELD;
struct SYMBOL_INSTANCE_REFERENCE; struct SYMBOL_INSTANCE_REFERENCE;
class PROPERTIES; class STRING_UTF8_MAP;
class EE_SELECTION; class EE_SELECTION;
class SCH_SEXPR_PLUGIN_CACHE; class SCH_SEXPR_PLUGIN_CACHE;
class LIB_SYMBOL; class LIB_SYMBOL;
@ -97,13 +97,13 @@ public:
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr, SCH_SHEET* aAppendToMe = nullptr,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet, void LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet,
int aVersion = SEXPR_SCHEMATIC_FILE_VERSION ); int aVersion = SEXPR_SCHEMATIC_FILE_VERSION );
void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic, void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void Format( SCH_SHEET* aSheet ); void Format( SCH_SHEET* aSheet );
@ -112,22 +112,22 @@ public:
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName, LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol, void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void CreateSymbolLib( const wxString& aLibraryPath, void CreateSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool DeleteSymbolLib( const wxString& aLibraryPath, bool DeleteSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void SaveLibrary( const wxString& aLibraryPath, void SaveLibrary( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool CheckHeader( const wxString& aFileName ) override; bool CheckHeader( const wxString& aFileName ) override;
bool IsSymbolLibWritable( const wxString& aLibraryPath ) override; bool IsSymbolLibWritable( const wxString& aLibraryPath ) override;
@ -160,8 +160,8 @@ private:
void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNestLevel ); void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNestLevel );
void saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aSheets, int aNestLevel ); void saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aSheets, int aNestLevel );
void cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties ); void cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties );
bool isBuffering( const PROPERTIES* aProperties ); bool isBuffering( const STRING_UTF8_MAP* aProperties );
protected: protected:
int m_version; ///< Version of file being loaded. int m_version; ///< Version of file being loaded.
@ -179,7 +179,7 @@ protected:
SCH_SEXPR_PLUGIN_CACHE* m_cache; SCH_SEXPR_PLUGIN_CACHE* m_cache;
/// initialize PLUGIN like a constructor would. /// initialize PLUGIN like a constructor would.
void init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties = nullptr ); void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
}; };
#endif // _SCH_SEXPR_PLUGIN_H_ #endif // _SCH_SEXPR_PLUGIN_H_

View File

@ -88,7 +88,7 @@ SCH_LEGACY_PLUGIN::~SCH_LEGACY_PLUGIN()
} }
void SCH_LEGACY_PLUGIN::init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties ) void SCH_LEGACY_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
{ {
m_version = 0; m_version = 0;
m_rootSheet = nullptr; m_rootSheet = nullptr;
@ -122,7 +122,7 @@ void SCH_LEGACY_PLUGIN::checkpoint()
SCH_SHEET* SCH_LEGACY_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* SCH_LEGACY_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties ) SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
{ {
wxASSERT( !aFileName || aSchematic != nullptr ); wxASSERT( !aFileName || aSchematic != nullptr );
@ -1447,7 +1447,7 @@ std::shared_ptr<BUS_ALIAS> SCH_LEGACY_PLUGIN::loadBusAlias( LINE_READER& aReader
void SCH_LEGACY_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic, void SCH_LEGACY_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." ); wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." ); wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
@ -2035,7 +2035,7 @@ void SCH_LEGACY_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
} }
void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties ) void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
{ {
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() ) if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{ {
@ -2049,7 +2049,7 @@ void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPER
} }
bool SCH_LEGACY_PLUGIN::writeDocFile( const PROPERTIES* aProperties ) bool SCH_LEGACY_PLUGIN::writeDocFile( const STRING_UTF8_MAP* aProperties )
{ {
std::string propName( SCH_LEGACY_PLUGIN::PropNoDocFile ); std::string propName( SCH_LEGACY_PLUGIN::PropNoDocFile );
@ -2060,7 +2060,7 @@ bool SCH_LEGACY_PLUGIN::writeDocFile( const PROPERTIES* aProperties )
} }
bool SCH_LEGACY_PLUGIN::isBuffering( const PROPERTIES* aProperties ) bool SCH_LEGACY_PLUGIN::isBuffering( const STRING_UTF8_MAP* aProperties )
{ {
return ( aProperties && aProperties->Exists( SCH_LEGACY_PLUGIN::PropBuffering ) ); return ( aProperties && aProperties->Exists( SCH_LEGACY_PLUGIN::PropBuffering ) );
} }
@ -2078,7 +2078,7 @@ int SCH_LEGACY_PLUGIN::GetModifyHash() const
void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList, void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2099,7 +2099,7 @@ void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2120,7 +2120,7 @@ void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLis
LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath, LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
const wxString& aSymbolName, const wxString& aSymbolName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2136,7 +2136,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol, void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2150,7 +2150,7 @@ void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMB
void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2164,7 +2164,7 @@ void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxStri
void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
if( wxFileExists( aLibraryPath ) ) if( wxFileExists( aLibraryPath ) )
{ {
@ -2183,7 +2183,7 @@ void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxFileName fn = aLibraryPath; wxFileName fn = aLibraryPath;
@ -2208,7 +2208,7 @@ bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
} }
void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const PROPERTIES* aProperties ) void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
if( !m_cache ) if( !m_cache )
m_cache = new SCH_LEGACY_PLUGIN_CACHE( aLibraryPath ); m_cache = new SCH_LEGACY_PLUGIN_CACHE( aLibraryPath );

View File

@ -41,7 +41,7 @@ class SCH_BUS_ENTRY_BASE;
class SCH_TEXT; class SCH_TEXT;
class SCH_SYMBOL; class SCH_SYMBOL;
class SCH_FIELD; class SCH_FIELD;
class PROPERTIES; class STRING_UTF8_MAP;
class SELECTION; class SELECTION;
class SCH_LEGACY_PLUGIN_CACHE; class SCH_LEGACY_PLUGIN_CACHE;
class LIB_SYMBOL; class LIB_SYMBOL;
@ -104,13 +104,13 @@ public:
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic, SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr, SCH_SHEET* aAppendToMe = nullptr,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen, void LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen,
int version = EESCHEMA_VERSION ); int version = EESCHEMA_VERSION );
void Save( const wxString& aFileName, SCH_SHEET* aScreen, SCHEMATIC* aSchematic, void Save( const wxString& aFileName, SCH_SHEET* aScreen, SCHEMATIC* aSchematic,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void Format( SCH_SHEET* aSheet ); void Format( SCH_SHEET* aSheet );
@ -118,22 +118,22 @@ public:
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath, const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName, LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol, void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void CreateSymbolLib( const wxString& aLibraryPath, void CreateSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool DeleteSymbolLib( const wxString& aLibraryPath, bool DeleteSymbolLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void SaveLibrary( const wxString& aLibraryPath, void SaveLibrary( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool CheckHeader( const wxString& aFileName ) override; bool CheckHeader( const wxString& aFileName ) override;
bool IsSymbolLibWritable( const wxString& aLibraryPath ) override; bool IsSymbolLibWritable( const wxString& aLibraryPath ) override;
@ -171,9 +171,9 @@ private:
void saveText( SCH_TEXT* aText ); void saveText( SCH_TEXT* aText );
void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias ); void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias );
void cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties ); void cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties );
bool writeDocFile( const PROPERTIES* aProperties ); bool writeDocFile( const STRING_UTF8_MAP* aProperties );
bool isBuffering( const PROPERTIES* aProperties ); bool isBuffering( const STRING_UTF8_MAP* aProperties );
protected: protected:
int m_version; ///< Version of file being loaded. int m_version; ///< Version of file being loaded.
@ -197,7 +197,7 @@ protected:
SCHEMATIC* m_schematic; SCHEMATIC* m_schematic;
/// initialize PLUGIN like a constructor would. /// initialize PLUGIN like a constructor would.
void init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties = nullptr ); void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
}; };
#endif // _SCH_LEGACY_PLUGIN_H_ #endif // _SCH_LEGACY_PLUGIN_H_

View File

@ -33,7 +33,7 @@
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <project/project_file.h> #include <project/project_file.h>
#include <project_rescue.h> #include <project_rescue.h>
#include <properties.h> #include <string_utf8_map.h>
#include <widgets/app_progress_dialog.h> #include <widgets/app_progress_dialog.h>
#include <general.h> #include <general.h>
@ -61,7 +61,7 @@ SYMBOL_LIB::SYMBOL_LIB( SCH_LIB_TYPE aType, const wxString& aFileName,
fileName = "unnamed.lib"; fileName = "unnamed.lib";
m_plugin.reset( SCH_IO_MGR::FindPlugin( m_pluginType ) ); m_plugin.reset( SCH_IO_MGR::FindPlugin( m_pluginType ) );
m_properties = std::make_unique<PROPERTIES>(); m_properties = std::make_unique<STRING_UTF8_MAP>();
m_mod_hash = 0; m_mod_hash = 0;
} }
@ -77,7 +77,7 @@ void SYMBOL_LIB::Save( bool aSaveDocFile )
wxString::Format( wxT( "no plugin defined for library `%s`." ), wxString::Format( wxT( "no plugin defined for library `%s`." ),
fileName.GetFullPath() ) ); fileName.GetFullPath() ) );
PROPERTIES props; STRING_UTF8_MAP props;
if( !aSaveDocFile ) if( !aSaveDocFile )
props[ SCH_LEGACY_PLUGIN::PropNoDocFile ] = ""; props[ SCH_LEGACY_PLUGIN::PropNoDocFile ] = "";

View File

@ -44,7 +44,7 @@ class LIB_SYMBOL;
class LIB_ID; class LIB_ID;
class LINE_READER; class LINE_READER;
class OUTPUTFORMATTER; class OUTPUTFORMATTER;
class PROPERTIES; class STRING_UTF8_MAP;
class SCH_PLUGIN; class SCH_PLUGIN;
class SYMBOL_LIB; class SYMBOL_LIB;
@ -316,7 +316,7 @@ private:
SCH_IO_MGR::SCH_FILE_T m_pluginType; SCH_IO_MGR::SCH_FILE_T m_pluginType;
std::unique_ptr< SCH_PLUGIN > m_plugin; std::unique_ptr< SCH_PLUGIN > m_plugin;
std::unique_ptr< PROPERTIES > m_properties; ///< Library properties std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library properties
}; };

View File

@ -167,7 +167,7 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( aFileType ) ); SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( aFileType ) );
bool res = true; // assume all libraries are successfully saved bool res = true; // assume all libraries are successfully saved
PROPERTIES properties; STRING_UTF8_MAP properties;
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" ); properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
auto it = m_libs.find( aLibrary ); auto it = m_libs.find( aLibrary );
@ -959,7 +959,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
LIB_SYMBOL* originalSymbol = aSymbolBuf->GetOriginal(); LIB_SYMBOL* originalSymbol = aSymbolBuf->GetOriginal();
wxCHECK( libSymbol && originalSymbol, false ); wxCHECK( libSymbol && originalSymbol, false );
SYMBOL_LIB_TABLE::SAVE_T result; SYMBOL_LIB_TABLE::SAVE_T result;
PROPERTIES properties; STRING_UTF8_MAP properties;
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" ); properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" ); wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
@ -1066,7 +1066,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" ); wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
// set properties to prevent save file on every symbol save // set properties to prevent save file on every symbol save
PROPERTIES properties; STRING_UTF8_MAP properties;
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" ); properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
// Delete the original symbol if the symbol name has been changed. // Delete the original symbol if the symbol name has been changed.

View File

@ -32,7 +32,7 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <project.h> #include <project.h>
#include <properties.h> #include <string_utf8_map.h>
#include <richio.h> #include <richio.h>
@ -186,7 +186,7 @@ public:
* Return the constant #PROPERTIES for this library (#LIB_TABLE_ROW). These are * Return the constant #PROPERTIES for this library (#LIB_TABLE_ROW). These are
* the "options" in a table. * the "options" in a table.
*/ */
const PROPERTIES* GetProperties() const { return properties.get(); } const STRING_UTF8_MAP* GetProperties() const { return properties.get(); }
/** /**
* Serialize this object as utf8 text to an #OUTPUTFORMATTER, and tries to * Serialize this object as utf8 text to an #OUTPUTFORMATTER, and tries to
@ -218,7 +218,7 @@ protected:
m_parent( aRow.m_parent ) m_parent( aRow.m_parent )
{ {
if( aRow.properties ) if( aRow.properties )
properties = std::make_unique<PROPERTIES>( *aRow.properties.get() ); properties = std::make_unique<STRING_UTF8_MAP>( *aRow.properties.get() );
else else
properties.reset(); properties.reset();
} }
@ -228,7 +228,7 @@ protected:
private: private:
virtual LIB_TABLE_ROW* do_clone() const = 0; virtual LIB_TABLE_ROW* do_clone() const = 0;
void setProperties( PROPERTIES* aProperties ); void setProperties( STRING_UTF8_MAP* aProperties );
wxString nickName; wxString nickName;
wxString uri_user; ///< what user entered from UI or loaded from disk wxString uri_user; ///< what user entered from UI or loaded from disk
@ -245,7 +245,7 @@ private:
bool m_loaded = false; ///< Whether the LIB_TABLE_ROW is loaded bool m_loaded = false; ///< Whether the LIB_TABLE_ROW is loaded
LIB_TABLE* m_parent; ///< Pointer to the table this row lives in (maybe null) LIB_TABLE* m_parent; ///< Pointer to the table this row lives in (maybe null)
std::unique_ptr< PROPERTIES > properties; std::unique_ptr<STRING_UTF8_MAP> properties;
std::mutex m_loadMutex; std::mutex m_loadMutex;
}; };
@ -506,7 +506,7 @@ public:
* a library table, this formatting is handled for you. * a library table, this formatting is handled for you.
* </p> * </p>
*/ */
static PROPERTIES* ParseOptions( const std::string& aOptionsList ); static STRING_UTF8_MAP* ParseOptions( const std::string& aOptionsList );
/** /**
* Returns a list of options from the aProperties parameter. * Returns a list of options from the aProperties parameter.
@ -518,7 +518,7 @@ public:
* @param aProperties is the PROPERTIES to format or NULL. If NULL the returned * @param aProperties is the PROPERTIES to format or NULL. If NULL the returned
* string will be empty. * string will be empty.
*/ */
static UTF8 FormatOptions( const PROPERTIES* aProperties ); static UTF8 FormatOptions( const STRING_UTF8_MAP* aProperties );
protected: protected:
/** /**

View File

@ -30,7 +30,7 @@
* A name/value tuple with unique names and optional values. The names * A name/value tuple with unique names and optional values. The names
* may be iterated alphabetically. * may be iterated alphabetically.
*/ */
class PROPERTIES : public std::map< std::string, UTF8 > class STRING_UTF8_MAP : public std::map< std::string, UTF8 >
{ {
public: public:
bool Clear( const std::string& aProperty ) bool Clear( const std::string& aProperty )

View File

@ -79,7 +79,9 @@ public:
if( m_choices.size() ) if( m_choices.size() )
{ {
unsigned int row = 0; unsigned int row = 0;
for( PROPERTIES::const_iterator it = m_choices.begin(); it != m_choices.end(); ++it, ++row )
for( STRING_UTF8_MAP::const_iterator it = m_choices.begin(); it != m_choices.end();
++it, ++row )
{ {
wxString item = FROM_UTF8( it->first.c_str() ); wxString item = FROM_UTF8( it->first.c_str() );
@ -113,7 +115,7 @@ public:
// Fill the grid with existing aOptions // Fill the grid with existing aOptions
string options = TO_UTF8( m_callers_options ); string options = TO_UTF8( m_callers_options );
PROPERTIES* props = LIB_TABLE::ParseOptions( options ); STRING_UTF8_MAP* props = LIB_TABLE::ParseOptions( options );
if( props ) if( props )
{ {
@ -121,7 +123,9 @@ public:
m_grid->AppendRows( props->size() - m_grid->GetNumberRows() ); m_grid->AppendRows( props->size() - m_grid->GetNumberRows() );
int row = 0; int row = 0;
for( PROPERTIES::const_iterator it = props->begin(); it != props->end(); ++it, ++row )
for( STRING_UTF8_MAP::const_iterator it = props->begin(); it != props->end();
++it, ++row )
{ {
m_grid->SetCellValue( row, 0, FROM_UTF8( it->first.c_str() ) ); m_grid->SetCellValue( row, 0, FROM_UTF8( it->first.c_str() ) );
m_grid->SetCellValue( row, 1, it->second ); m_grid->SetCellValue( row, 1, it->second );
@ -141,7 +145,7 @@ public:
if( !DIALOG_SHIM::TransferDataFromWindow() ) if( !DIALOG_SHIM::TransferDataFromWindow() )
return false; return false;
PROPERTIES props; STRING_UTF8_MAP props;
const int rowCount = m_grid->GetNumberRows(); const int rowCount = m_grid->GetNumberRows();
for( int row = 0; row<rowCount; ++row ) for( int row = 0; row<rowCount; ++row )
@ -162,7 +166,7 @@ public:
private: private:
const wxString& m_callers_options; const wxString& m_callers_options;
wxString* m_result; wxString* m_result;
PROPERTIES m_choices; STRING_UTF8_MAP m_choices;
wxString m_initial_help; wxString m_initial_help;
bool m_grid_widths_dirty; bool m_grid_widths_dirty;

View File

@ -24,7 +24,7 @@
#ifndef __BOARD_EXPORTER_BASE_H #ifndef __BOARD_EXPORTER_BASE_H
#define __BOARD_EXPORTER_BASE_H #define __BOARD_EXPORTER_BASE_H
#include <properties.h> #include <string_utf8_map.h>
#include <wx/file.h> #include <wx/file.h>
class BOARD; class BOARD;
@ -67,7 +67,7 @@ public:
virtual bool Run() = 0; virtual bool Run() = 0;
protected: protected:
PROPERTIES m_properties; STRING_UTF8_MAP m_properties;
BOARD* m_board = nullptr; BOARD* m_board = nullptr;
wxFileName m_outputFilePath; wxFileName m_outputFilePath;
REPORTER* m_reporter = nullptr; REPORTER* m_reporter = nullptr;

View File

@ -704,7 +704,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
try try
{ {
PROPERTIES props; STRING_UTF8_MAP props;
char xbuf[30]; char xbuf[30];
char ybuf[30]; char ybuf[30];

View File

@ -160,7 +160,7 @@ IO_MGR::PCB_FILE_T IO_MGR::GuessPluginTypeFromLibPath( const wxString& aLibPath
BOARD* IO_MGR::Load( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aAppendToMe, BOARD* IO_MGR::Load( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
// release the PLUGIN even if an exception is thrown. // release the PLUGIN even if an exception is thrown.
@ -176,7 +176,7 @@ BOARD* IO_MGR::Load( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aAp
void IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoard, void IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoard,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// release the PLUGIN even if an exception is thrown. // release the PLUGIN even if an exception is thrown.
PLUGIN::RELEASER pi( PluginFind( aFileType ) ); PLUGIN::RELEASER pi( PluginFind( aFileType ) );

View File

@ -35,7 +35,7 @@
class BOARD; class BOARD;
class PLUGIN; class PLUGIN;
class FOOTPRINT; class FOOTPRINT;
class PROPERTIES; class STRING_UTF8_MAP;
class PROJECT; class PROJECT;
class PROGRESS_REPORTER; class PROGRESS_REPORTER;
@ -210,7 +210,7 @@ public:
* be loaded. * be loaded.
*/ */
static BOARD* Load( PCB_FILE_T aFileType, const wxString& aFileName, static BOARD* Load( PCB_FILE_T aFileType, const wxString& aFileName,
BOARD* aAppendToMe = nullptr, const PROPERTIES* aProperties = nullptr, BOARD* aAppendToMe = nullptr, const STRING_UTF8_MAP* aProperties = nullptr,
PROJECT* aProject = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ); PROGRESS_REPORTER* aProgressReporter = nullptr );
@ -234,7 +234,7 @@ public:
* @throw IO_ERROR if there is a problem saving or exporting. * @throw IO_ERROR if there is a problem saving or exporting.
*/ */
static void Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoard, static void Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoard,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
}; };
@ -316,7 +316,7 @@ public:
* possible. * possible.
*/ */
virtual BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, virtual BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ); PROGRESS_REPORTER* aProgressReporter = nullptr );
/** /**
@ -348,7 +348,7 @@ public:
* @throw IO_ERROR if there is a problem saving or exporting. * @throw IO_ERROR if there is a problem saving or exporting.
*/ */
virtual void Save( const wxString& aFileName, BOARD* aBoard, virtual void Save( const wxString& aFileName, BOARD* aBoard,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Return a list of footprint names contained within the library at @a aLibraryPath. * Return a list of footprint names contained within the library at @a aLibraryPath.
@ -365,7 +365,7 @@ public:
* @throw IO_ERROR if the library cannot be found, or footprint cannot be loaded. * @throw IO_ERROR if the library cannot be found, or footprint cannot be loaded.
*/ */
virtual void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, virtual void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties = nullptr ); bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Generate a timestamp representing all the files in the library (including the library * Generate a timestamp representing all the files in the library (including the library
@ -393,7 +393,7 @@ public:
* @throw IO_ERROR if there is an error prefetching the library. * @throw IO_ERROR if there is an error prefetching the library.
*/ */
virtual void PrefetchLib( const wxString& aLibraryPath, virtual void PrefetchLib( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Load a footprint having @a aFootprintName from the @a aLibraryPath containing a library * Load a footprint having @a aFootprintName from the @a aLibraryPath containing a library
@ -419,7 +419,7 @@ public:
virtual FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, virtual FOOTPRINT* FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
bool aKeepUUID = false, bool aKeepUUID = false,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* A version of FootprintLoad() for use after FootprintEnumerate() for more efficient * A version of FootprintLoad() for use after FootprintEnumerate() for more efficient
@ -427,13 +427,13 @@ public:
*/ */
virtual const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath, virtual const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Check for the existence of a footprint. * Check for the existence of a footprint.
*/ */
virtual bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, virtual bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Write @a aFootprint to an existing library located at @a aLibraryPath. * Write @a aFootprint to an existing library located at @a aLibraryPath.
@ -452,7 +452,7 @@ public:
* @throw IO_ERROR if there is a problem saving. * @throw IO_ERROR if there is a problem saving.
*/ */
virtual void FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, virtual void FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Delete @a aFootprintName from the library at @a aLibraryPath. * Delete @a aFootprintName from the library at @a aLibraryPath.
@ -469,7 +469,7 @@ public:
* @throw IO_ERROR if there is a problem finding the footprint or the library, or deleting it. * @throw IO_ERROR if there is a problem finding the footprint or the library, or deleting it.
*/ */
virtual void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, virtual void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Create a new empty footprint library at @a aLibraryPath empty. * Create a new empty footprint library at @a aLibraryPath empty.
@ -488,7 +488,7 @@ public:
* @throw IO_ERROR if there is a problem finding the library, or creating it. * @throw IO_ERROR if there is a problem finding the library, or creating it.
*/ */
virtual void FootprintLibCreate( const wxString& aLibraryPath, virtual void FootprintLibCreate( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Delete an existing footprint library and returns true, or if library does not * Delete an existing footprint library and returns true, or if library does not
@ -507,7 +507,7 @@ public:
* @throw IO_ERROR if there is a problem deleting an existing library. * @throw IO_ERROR if there is a problem deleting an existing library.
*/ */
virtual bool FootprintLibDelete( const wxString& aLibraryPath, virtual bool FootprintLibDelete( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ); const STRING_UTF8_MAP* aProperties = nullptr );
/** /**
* Return true if the library at @a aLibraryPath is writable. * Return true if the library at @a aLibraryPath is writable.
@ -548,7 +548,7 @@ public:
* This would require a 3 column list, and introducing wx GUI knowledge to * This would require a 3 column list, and introducing wx GUI knowledge to
* PLUGIN, which has been avoided to date. * PLUGIN, which has been avoided to date.
*/ */
virtual void FootprintLibOptions( PROPERTIES* aListToAppendTo ) const; virtual void FootprintLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const;
virtual ~PLUGIN() virtual ~PLUGIN()
{ {

View File

@ -350,7 +350,7 @@ BOARD_ITEM* CLIPBOARD_IO::Parse()
void CLIPBOARD_IO::Save( const wxString& aFileName, BOARD* aBoard, void CLIPBOARD_IO::Save( const wxString& aFileName, BOARD* aBoard,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
init( aProperties ); init( aProperties );
@ -395,7 +395,7 @@ void CLIPBOARD_IO::Save( const wxString& aFileName, BOARD* aBoard,
BOARD* CLIPBOARD_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* CLIPBOARD_IO::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
std::string result; std::string result;

View File

@ -48,7 +48,7 @@ public:
* Saves the entire board to the clipboard formatted using the PCB_PLUGIN formatting * Saves the entire board to the clipboard formatted using the PCB_PLUGIN formatting
*/ */
void Save( const wxString& aFileName, BOARD* aBoard, void Save( const wxString& aFileName, BOARD* aBoard,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
/* /*
* Write all the settings of the BOARD* set by setBoard() and then adds all the * Write all the settings of the BOARD* set by setBoard() and then adds all the
@ -59,7 +59,7 @@ public:
BOARD_ITEM* Parse(); BOARD_ITEM* Parse();
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
void SetBoard( BOARD* aBoard ); void SetBoard( BOARD* aBoard );

View File

@ -23,7 +23,7 @@
*/ */
#include <io_mgr.h> #include <io_mgr.h>
#include <properties.h> #include <string_utf8_map.h>
#include <wx/translation.h> #include <wx/translation.h>
@ -43,7 +43,7 @@ static void not_implemented( PLUGIN* aPlugin, const char* aCaller )
} }
BOARD* PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties, BOARD* PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter ) PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter )
{ {
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -57,7 +57,7 @@ std::vector<FOOTPRINT*> PLUGIN::GetImportedCachedLibraryFootprints()
return std::vector<FOOTPRINT*>(); return std::vector<FOOTPRINT*>();
} }
void PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) void PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -65,21 +65,21 @@ void PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* a
void PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties ) bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
} }
void PLUGIN::PrefetchLib( const wxString&, const PROPERTIES* ) void PLUGIN::PrefetchLib( const wxString&, const STRING_UTF8_MAP* )
{ {
} }
const FOOTPRINT* PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath, const FOOTPRINT* PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// default implementation // default implementation
return FootprintLoad( aLibraryPath, aFootprintName, false, aProperties ); return FootprintLoad( aLibraryPath, aFootprintName, false, aProperties );
@ -87,7 +87,7 @@ const FOOTPRINT* PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath,
bool PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, bool PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// default implementation // default implementation
return FootprintLoad( aLibraryPath, aFootprintName, true, aProperties ) != nullptr; return FootprintLoad( aLibraryPath, aFootprintName, true, aProperties ) != nullptr;
@ -95,7 +95,7 @@ bool PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFoo
FOOTPRINT* PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, FOOTPRINT* PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID, const PROPERTIES* aProperties ) bool aKeepUUID, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -104,7 +104,7 @@ FOOTPRINT* PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxString&
void PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, void PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -112,21 +112,21 @@ void PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFoot
void PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, void PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
} }
void PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* aProperties ) void PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
} }
bool PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* aProperties ) bool PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface. // not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ ); not_implemented( this, __FUNCTION__ );
@ -142,7 +142,7 @@ bool PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath )
} }
void PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const void PLUGIN::FootprintLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
{ {
// disable all these in another couple of months, after everyone has seen them: // disable all these in another couple of months, after everyone has seen them:
#if 1 #if 1

View File

@ -63,7 +63,7 @@ const wxString ALTIUM_CIRCUIT_MAKER_PLUGIN::GetFileExtension() const
BOARD* ALTIUM_CIRCUIT_MAKER_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* ALTIUM_CIRCUIT_MAKER_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
m_props = aProperties; m_props = aProperties;

View File

@ -38,7 +38,7 @@ class ALTIUM_CIRCUIT_MAKER_PLUGIN : public PLUGIN
public: public:
const wxString PluginName() const override; const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
PROJECT* aProject = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
@ -54,7 +54,7 @@ public:
~ALTIUM_CIRCUIT_MAKER_PLUGIN(); ~ALTIUM_CIRCUIT_MAKER_PLUGIN();
private: private:
const PROPERTIES* m_props; const STRING_UTF8_MAP* m_props;
BOARD* m_board; BOARD* m_board;
}; };

View File

@ -63,7 +63,7 @@ const wxString ALTIUM_CIRCUIT_STUDIO_PLUGIN::GetFileExtension() const
BOARD* ALTIUM_CIRCUIT_STUDIO_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* ALTIUM_CIRCUIT_STUDIO_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
m_props = aProperties; m_props = aProperties;

View File

@ -38,7 +38,7 @@ class ALTIUM_CIRCUIT_STUDIO_PLUGIN : public PLUGIN
public: public:
const wxString PluginName() const override; const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
const wxString GetFileExtension() const override; const wxString GetFileExtension() const override;
@ -53,7 +53,7 @@ public:
~ALTIUM_CIRCUIT_STUDIO_PLUGIN(); ~ALTIUM_CIRCUIT_STUDIO_PLUGIN();
private: private:
const PROPERTIES* m_props; const STRING_UTF8_MAP* m_props;
BOARD* m_board; BOARD* m_board;
}; };

View File

@ -63,7 +63,7 @@ const wxString ALTIUM_DESIGNER_PLUGIN::GetFileExtension() const
BOARD* ALTIUM_DESIGNER_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* ALTIUM_DESIGNER_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
m_props = aProperties; m_props = aProperties;
@ -138,7 +138,7 @@ long long ALTIUM_DESIGNER_PLUGIN::GetLibraryTimestamp( const wxString& aLibraryP
void ALTIUM_DESIGNER_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, void ALTIUM_DESIGNER_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames,
const wxString& aLibraryPath, bool aBestEfforts, const wxString& aLibraryPath, bool aBestEfforts,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
ALTIUM_COMPOUND_FILE altiumLibFile( aLibraryPath ); ALTIUM_COMPOUND_FILE altiumLibFile( aLibraryPath );
@ -186,7 +186,7 @@ void ALTIUM_DESIGNER_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames
FOOTPRINT* ALTIUM_DESIGNER_PLUGIN::FootprintLoad( const wxString& aLibraryPath, FOOTPRINT* ALTIUM_DESIGNER_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID, const wxString& aFootprintName, bool aKeepUUID,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
ALTIUM_COMPOUND_FILE altiumLibFile( aLibraryPath ); ALTIUM_COMPOUND_FILE altiumLibFile( aLibraryPath );

View File

@ -40,7 +40,7 @@ public:
const wxString PluginName() const override; const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
PROJECT* aProject = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
@ -49,11 +49,11 @@ public:
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override; long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties = nullptr ) override; bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false, bool aKeepUUID = false,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
//bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, const PROPERTIES* aProperties = nullptr ); //bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, const PROPERTIES* aProperties = nullptr );
@ -65,7 +65,7 @@ public:
~ALTIUM_DESIGNER_PLUGIN(); ~ALTIUM_DESIGNER_PLUGIN();
private: private:
const PROPERTIES* m_props; const STRING_UTF8_MAP* m_props;
BOARD* m_board; BOARD* m_board;
}; };

View File

@ -28,7 +28,7 @@
#include <cadstar_pcb_archive_plugin.h> #include <cadstar_pcb_archive_plugin.h>
#include <board.h> #include <board.h>
#include <footprint.h> #include <footprint.h>
#include <properties.h> #include <string_utf8_map.h>
std::map<wxString, PCB_LAYER_ID> CADSTAR_PCB_ARCHIVE_PLUGIN::DefaultLayerMappingCallback( std::map<wxString, PCB_LAYER_ID> CADSTAR_PCB_ARCHIVE_PLUGIN::DefaultLayerMappingCallback(
@ -106,7 +106,7 @@ std::vector<FOOTPRINT*> CADSTAR_PCB_ARCHIVE_PLUGIN::GetImportedCachedLibraryFoot
BOARD* CADSTAR_PCB_ARCHIVE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* CADSTAR_PCB_ARCHIVE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
m_props = aProperties; m_props = aProperties;

View File

@ -39,7 +39,7 @@ public:
const wxString PluginName() const override; const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
const wxString GetFileExtension() const override; const wxString GetFileExtension() const override;
@ -74,7 +74,7 @@ public:
private: private:
void clearLoadedFootprints(); void clearLoadedFootprints();
const PROPERTIES* m_props; const STRING_UTF8_MAP* m_props;
BOARD* m_board; BOARD* m_board;
std::vector<FOOTPRINT*> m_loaded_footprints; std::vector<FOOTPRINT*> m_loaded_footprints;
bool m_show_layer_mapping_warnings; bool m_show_layer_mapping_warnings;

View File

@ -64,7 +64,7 @@ Load() TODO's
#include <geometry/geometry_utils.h> #include <geometry/geometry_utils.h>
#include <string_utils.h> #include <string_utils.h>
#include <locale_io.h> #include <locale_io.h>
#include <properties.h> #include <string_utf8_map.h>
#include <trigo.h> #include <trigo.h>
#include <math/util.h> // for KiROUND #include <math/util.h> // for KiROUND
#include <progress_reporter.h> #include <progress_reporter.h>
@ -358,7 +358,7 @@ wxSize inline EAGLE_PLUGIN::kicad_fontz( const ECOORD& d, int aTextThickness ) c
BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* EAGLE_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -501,7 +501,7 @@ std::vector<FOOTPRINT*> EAGLE_PLUGIN::GetImportedCachedLibraryFootprints()
} }
void EAGLE_PLUGIN::init( const PROPERTIES* aProperties ) void EAGLE_PLUGIN::init( const STRING_UTF8_MAP* aProperties )
{ {
m_hole_count = 0; m_hole_count = 0;
m_min_trace = 0; m_min_trace = 0;
@ -3231,7 +3231,7 @@ void EAGLE_PLUGIN::cacheLib( const wxString& aLibPath )
void EAGLE_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void EAGLE_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties ) bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
{ {
wxString errorMsg; wxString errorMsg;
@ -3259,7 +3259,7 @@ void EAGLE_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxS
FOOTPRINT* EAGLE_PLUGIN::FootprintLoad( const wxString& aLibraryPath, FOOTPRINT* EAGLE_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID, const wxString& aFootprintName, bool aKeepUUID,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
init( aProperties ); init( aProperties );
cacheLib( aLibraryPath ); cacheLib( aLibraryPath );
@ -3275,7 +3275,7 @@ FOOTPRINT* EAGLE_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
} }
void EAGLE_PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const void EAGLE_PLUGIN::FootprintLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
{ {
PLUGIN::FootprintLibOptions( aListToAppendTo ); PLUGIN::FootprintLibOptions( aListToAppendTo );
} }

View File

@ -132,7 +132,7 @@ public:
const wxString PluginName() const override; const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override; std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
@ -140,11 +140,11 @@ public:
const wxString GetFileExtension() const override; const wxString GetFileExtension() const override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties = nullptr) override; bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false, bool aKeepUUID = false,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{ {
@ -156,7 +156,7 @@ public:
return false; // until someone writes others like FootprintSave(), etc. return false; // until someone writes others like FootprintSave(), etc.
} }
void FootprintLibOptions( PROPERTIES* aProperties ) const override; void FootprintLibOptions( STRING_UTF8_MAP* aProperties ) const override;
typedef int BIU; typedef int BIU;
@ -178,7 +178,7 @@ public:
private: private:
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed. /// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void init( const PROPERTIES* aProperties ); void init( const STRING_UTF8_MAP* aProperties );
void checkpoint(); void checkpoint();
@ -332,7 +332,7 @@ private:
///< lookup key is either libname.packagename or simply ///< lookup key is either libname.packagename or simply
///< packagename if FootprintLoad() or FootprintEnumberate() ///< packagename if FootprintLoad() or FootprintEnumberate()
const PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, may be NULL. const STRING_UTF8_MAP* m_props; ///< passed via Save() or Load(), no ownership, may be NULL.
BOARD* m_board; ///< which BOARD is being worked on, no ownership here BOARD* m_board; ///< which BOARD is being worked on, no ownership here
PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr

View File

@ -59,7 +59,7 @@ const wxString FABMASTER_PLUGIN::GetFileExtension() const
BOARD* FABMASTER_PLUGIN::Load( const wxString &aFileName, BOARD *aAppendToMe, BOARD* FABMASTER_PLUGIN::Load( const wxString &aFileName, BOARD *aAppendToMe,
const PROPERTIES *aProperties, PROJECT *aProject, const STRING_UTF8_MAP* aProperties, PROJECT *aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
m_props = aProperties; m_props = aProperties;

View File

@ -39,7 +39,7 @@ public:
const wxString PluginName() const override; const wxString PluginName() const override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
const wxString GetFileExtension() const override; const wxString GetFileExtension() const override;
@ -54,10 +54,10 @@ public:
~FABMASTER_PLUGIN(); ~FABMASTER_PLUGIN();
private: private:
const PROPERTIES* m_props; const STRING_UTF8_MAP* m_props;
BOARD* m_board; BOARD* m_board;
FABMASTER m_fabmaster; FABMASTER m_fabmaster;
}; };
#endif // FABMASTER_PLUGIN_H_ #endif // FABMASTER_PLUGIN_H_

View File

@ -853,7 +853,7 @@ GPCB_PLUGIN::~GPCB_PLUGIN()
} }
void GPCB_PLUGIN::init( const PROPERTIES* aProperties ) void GPCB_PLUGIN::init( const STRING_UTF8_MAP* aProperties )
{ {
m_props = aProperties; m_props = aProperties;
} }
@ -872,7 +872,7 @@ void GPCB_PLUGIN::validateCache( const wxString& aLibraryPath, bool checkModifie
void GPCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void GPCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties ) bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
wxDir dir( aLibraryPath ); wxDir dir( aLibraryPath );
@ -913,7 +913,7 @@ void GPCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxSt
const FOOTPRINT* GPCB_PLUGIN::getFootprint( const wxString& aLibraryPath, const FOOTPRINT* GPCB_PLUGIN::getFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties, const STRING_UTF8_MAP* aProperties,
bool checkModified ) bool checkModified )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -935,7 +935,7 @@ const FOOTPRINT* GPCB_PLUGIN::getFootprint( const wxString& aLibraryPath,
const FOOTPRINT* GPCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath, const FOOTPRINT* GPCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
return getFootprint( aLibraryPath, aFootprintName, aProperties, false ); return getFootprint( aLibraryPath, aFootprintName, aProperties, false );
} }
@ -944,7 +944,7 @@ const FOOTPRINT* GPCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPa
FOOTPRINT* GPCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath, FOOTPRINT* GPCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
bool aKeepUUID, bool aKeepUUID,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true ); const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true );
@ -960,7 +960,7 @@ FOOTPRINT* GPCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
void GPCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, void GPCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -978,7 +978,7 @@ void GPCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString&
} }
bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* aProperties ) bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
wxFileName fn; wxFileName fn;
fn.SetPath( aLibraryPath ); fn.SetPath( aLibraryPath );

View File

@ -58,21 +58,21 @@ public:
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, bool aBestEfforts,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath, const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false, bool aKeepUUID = false,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool FootprintLibDelete( const wxString& aLibraryPath, bool FootprintLibDelete( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override; long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
@ -90,19 +90,19 @@ private:
void validateCache( const wxString& aLibraryPath, bool checkModified = true ); void validateCache( const wxString& aLibraryPath, bool checkModified = true );
const FOOTPRINT* getFootprint( const wxString& aLibraryPath, const wxString& aFootprintName, const FOOTPRINT* getFootprint( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties, bool checkModified ); const STRING_UTF8_MAP* aProperties, bool checkModified );
void init( const PROPERTIES* aProperties ); void init( const STRING_UTF8_MAP* aProperties );
friend class GPCB_FPL_CACHE; friend class GPCB_FPL_CACHE;
protected: protected:
wxString m_error; ///< for throwing exceptions wxString m_error; ///< for throwing exceptions
const PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, may be NULL. const STRING_UTF8_MAP* m_props; ///< passed via Save() or Load(), no ownership, may be NULL.
GPCB_FPL_CACHE* m_cache; ///< Footprint library cache. GPCB_FPL_CACHE* m_cache; ///< Footprint library cache.
int m_ctl; int m_ctl;
LINE_READER* m_reader; ///< no ownership here. LINE_READER* m_reader; ///< no ownership here.
wxString m_filename; ///< for saves only, name is in m_reader for loads wxString m_filename; ///< for saves only, name is in m_reader for loads
}; };
#endif // _GPCB_PLUGIN_H_ #endif // _GPCB_PLUGIN_H_

View File

@ -339,7 +339,7 @@ long long FP_CACHE::GetTimestamp( const wxString& aLibPath )
} }
void PCB_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) void PCB_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2435,7 +2435,7 @@ PCB_PLUGIN::~PCB_PLUGIN()
BOARD* PCB_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* PCB_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
FILE_LINE_READER reader( aFileName ); FILE_LINE_READER reader( aFileName );
@ -2465,7 +2465,7 @@ BOARD* PCB_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
} }
BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPERTIES* aProperties, BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount) PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount)
{ {
init( aProperties ); init( aProperties );
@ -2501,7 +2501,7 @@ BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPE
} }
void PCB_PLUGIN::init( const PROPERTIES* aProperties ) void PCB_PLUGIN::init( const STRING_UTF8_MAP* aProperties )
{ {
m_board = nullptr; m_board = nullptr;
m_reader = nullptr; m_reader = nullptr;
@ -2522,7 +2522,7 @@ void PCB_PLUGIN::validateCache( const wxString& aLibraryPath, bool checkModified
void PCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath, void PCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath,
bool aBestEfforts, const PROPERTIES* aProperties ) bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
wxDir dir( aLibPath ); wxDir dir( aLibPath );
@ -2552,7 +2552,7 @@ void PCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxStr
const FOOTPRINT* PCB_PLUGIN::getFootprint( const wxString& aLibraryPath, const FOOTPRINT* PCB_PLUGIN::getFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties, const STRING_UTF8_MAP* aProperties,
bool checkModified ) bool checkModified )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2580,14 +2580,14 @@ const FOOTPRINT* PCB_PLUGIN::getFootprint( const wxString& aLibraryPath,
const FOOTPRINT* PCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath, const FOOTPRINT* PCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
return getFootprint( aLibraryPath, aFootprintName, aProperties, false ); return getFootprint( aLibraryPath, aFootprintName, aProperties, false );
} }
bool PCB_PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, bool PCB_PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
// Note: checking the cache sounds like a good idea, but won't catch files which differ // Note: checking the cache sounds like a good idea, but won't catch files which differ
// only in case. // only in case.
@ -2605,7 +2605,7 @@ bool PCB_PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString&
FOOTPRINT* PCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath, FOOTPRINT* PCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
bool aKeepUUID, bool aKeepUUID,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true ); const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true );
@ -2627,7 +2627,7 @@ FOOTPRINT* PCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2721,7 +2721,7 @@ void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* a
void PCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, void PCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2746,7 +2746,7 @@ long long PCB_PLUGIN::GetLibraryTimestamp( const wxString& aLibraryPath ) const
} }
void PCB_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* aProperties ) void PCB_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
if( wxDir::Exists( aLibraryPath ) ) if( wxDir::Exists( aLibraryPath ) )
{ {
@ -2764,7 +2764,7 @@ void PCB_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const PROPERT
} }
bool PCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* aProperties ) bool PCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{ {
wxFileName fn; wxFileName fn;
fn.SetPath( aLibraryPath ); fn.SetPath( aLibraryPath );

View File

@ -190,42 +190,42 @@ public:
} }
void Save( const wxString& aFileName, BOARD* aBoard, void Save( const wxString& aFileName, BOARD* aBoard,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
BOARD* DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPERTIES* aProperties, BOARD* DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount ); PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount );
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const PROPERTIES* aProperties = nullptr ) override; bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr ) override;
const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath, const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false, bool aKeepUUID = false,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, void FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override; long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
void FootprintLibCreate( const wxString& aLibraryPath, void FootprintLibCreate( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr) override; const STRING_UTF8_MAP* aProperties = nullptr) override;
bool FootprintLibDelete( const wxString& aLibraryPath, bool FootprintLibDelete( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool IsFootprintLibWritable( const wxString& aLibraryPath ) override; bool IsFootprintLibWritable( const wxString& aLibraryPath ) override;
@ -260,9 +260,9 @@ protected:
void validateCache( const wxString& aLibraryPath, bool checkModified = true ); void validateCache( const wxString& aLibraryPath, bool checkModified = true );
const FOOTPRINT* getFootprint( const wxString& aLibraryPath, const wxString& aFootprintName, const FOOTPRINT* getFootprint( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties, bool checkModified ); const STRING_UTF8_MAP* aProperties, bool checkModified );
void init( const PROPERTIES* aProperties ); void init( const STRING_UTF8_MAP* aProperties );
/// formats the board setup information /// formats the board setup information
void formatSetup( const BOARD* aBoard, int aNestLevel = 0 ) const; void formatSetup( const BOARD* aBoard, int aNestLevel = 0 ) const;
@ -325,8 +325,7 @@ protected:
wxString m_error; ///< for throwing exceptions wxString m_error; ///< for throwing exceptions
BOARD* m_board; ///< which BOARD, no ownership here BOARD* m_board; ///< which BOARD, no ownership here
const const STRING_UTF8_MAP* m_props; ///< passed via Save() or Load(), no ownership, may be NULL.
PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, may be NULL.
FP_CACHE* m_cache; ///< Footprint library cache. FP_CACHE* m_cache; ///< Footprint library cache.
LINE_READER* m_reader; ///< no ownership here. LINE_READER* m_reader; ///< no ownership here.

View File

@ -68,7 +68,7 @@
#include <string_utils.h> #include <string_utils.h>
#include <locale_io.h> #include <locale_io.h>
#include <macros.h> #include <macros.h>
#include <properties.h> #include <string_utf8_map.h>
#include <zones.h> #include <zones.h>
#include <board.h> #include <board.h>
@ -403,7 +403,7 @@ static inline long hexParse( const char* next, const char** out = nullptr )
BOARD* LEGACY_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* LEGACY_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2866,7 +2866,7 @@ EDA_ANGLE LEGACY_PLUGIN::degParse( const char* aValue, const char** nptrptr )
} }
void LEGACY_PLUGIN::init( const PROPERTIES* aProperties ) void LEGACY_PLUGIN::init( const STRING_UTF8_MAP* aProperties )
{ {
m_loading_format_version = 0; m_loading_format_version = 0;
m_cu_count = 16; m_cu_count = 16;
@ -3155,7 +3155,7 @@ void LEGACY_PLUGIN::cacheLib( const wxString& aLibraryPath )
void LEGACY_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath, void LEGACY_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath,
bool aBestEfforts, const PROPERTIES* aProperties ) bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
wxString errorMsg; wxString errorMsg;
@ -3184,7 +3184,7 @@ void LEGACY_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wx
FOOTPRINT* LEGACY_PLUGIN::FootprintLoad( const wxString& aLibraryPath, FOOTPRINT* LEGACY_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID, const wxString& aFootprintName, bool aKeepUUID,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
LOCALE_IO toggle; // toggles on, then off, the C locale. LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -3208,7 +3208,7 @@ FOOTPRINT* LEGACY_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
bool LEGACY_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, bool LEGACY_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath,
const PROPERTIES* aProperties ) const STRING_UTF8_MAP* aProperties )
{ {
wxFileName fn = aLibraryPath; wxFileName fn = aLibraryPath;

View File

@ -75,19 +75,19 @@ public:
} }
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, PROJECT* aProject = nullptr, const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, bool aBestEfforts,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false, bool aKeepUUID = false,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool FootprintLibDelete( const wxString& aLibraryPath, bool FootprintLibDelete( const wxString& aLibraryPath,
const PROPERTIES* aProperties = nullptr ) override; const STRING_UTF8_MAP* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override; long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
@ -104,7 +104,7 @@ public:
protected: protected:
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed. /// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void init( const PROPERTIES* aProperties ); void init( const STRING_UTF8_MAP* aProperties );
void checkpoint(); void checkpoint();
@ -181,7 +181,7 @@ protected:
wxString m_error; ///< for throwing exceptions wxString m_error; ///< for throwing exceptions
BOARD* m_board; ///< which BOARD, no ownership here BOARD* m_board; ///< which BOARD, no ownership here
const PROPERTIES* m_props; ///< passed via Save() or Load(), no ownership, const STRING_UTF8_MAP* m_props; ///< passed via Save() or Load(), no ownership,
///< may be NULL. ///< may be NULL.
PROGRESS_REPORTER* m_progressReporter; ///< may be NULL, no ownership PROGRESS_REPORTER* m_progressReporter; ///< may be NULL, no ownership
unsigned m_lastProgressLine; unsigned m_lastProgressLine;

View File

@ -67,7 +67,7 @@ const wxString PCAD_PLUGIN::GetFileExtension() const
BOARD* PCAD_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, BOARD* PCAD_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
const PROPERTIES* aProperties, PROJECT* aProject, const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter ) PROGRESS_REPORTER* aProgressReporter )
{ {
wxXmlDocument xmlDoc; wxXmlDocument xmlDoc;

View File

@ -42,7 +42,7 @@ public:
BOARD* Load( const wxString& aFileName, BOARD* Load( const wxString& aFileName,
BOARD* aAppendToMe, BOARD* aAppendToMe,
const PROPERTIES* aProperties = nullptr, const STRING_UTF8_MAP* aProperties = nullptr,
PROJECT* aProject = nullptr, PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override; PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
@ -55,7 +55,7 @@ public:
} }
private: private:
const PROPERTIES* m_props; const STRING_UTF8_MAP* m_props;
BOARD* m_board; BOARD* m_board;
}; };

View File

@ -54,7 +54,7 @@
#include <origin_viewitem.h> #include <origin_viewitem.h>
#include <pcb_edit_frame.h> #include <pcb_edit_frame.h>
#include <pcb_painter.h> #include <pcb_painter.h>
#include <properties.h> #include <string_utf8_map.h>
#include <settings/color_settings.h> #include <settings/color_settings.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <footprint_edit_frame.h> #include <footprint_edit_frame.h>
@ -1197,7 +1197,7 @@ int PCB_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName )
// Load the data // Load the data
try try
{ {
PROPERTIES props; STRING_UTF8_MAP props;
char xbuf[30]; char xbuf[30];
char ybuf[30]; char ybuf[30];

View File

@ -85,7 +85,7 @@ you can either use the basic targets, or use the FindPython tools:
# Python method: # Python method:
Python_add_library(MyModule2 src2.cpp) Python_add_library(MyModule2 src2.cpp)
target_link_libraries(MyModule2 pybind11::headers) target_link_libraries(MyModule2 pybind11::headers)
set_target_properties(MyModule2 PROPERTIES set_target_properties(MyModule2 STRING_UTF8_MAP
INTERPROCEDURAL_OPTIMIZATION ON INTERPROCEDURAL_OPTIMIZATION ON
CXX_VISIBILITY_PRESET ON CXX_VISIBILITY_PRESET ON
VISIBILITY_INLINES_HIDDEN ON) VISIBILITY_INLINES_HIDDEN ON)
@ -220,7 +220,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/pybind11Targets.cmake")
# Easier to use / remember # Easier to use / remember
add_library(pybind11::headers IMPORTED INTERFACE) add_library(pybind11::headers IMPORTED INTERFACE)
set_target_properties(pybind11::headers PROPERTIES INTERFACE_LINK_LIBRARIES set_target_properties(pybind11::headers STRING_UTF8_MAP INTERFACE_LINK_LIBRARIES
pybind11::pybind11_headers) pybind11::pybind11_headers)
include("${CMAKE_CURRENT_LIST_DIR}/pybind11Common.cmake") include("${CMAKE_CURRENT_LIST_DIR}/pybind11Common.cmake")