Browse Source

Remove basic masking class map_string_utf8

This is just std::map<std::string, UTF8>, using the class just masks
what it is and adds unclear functions.
jobs
Seth Hillbrand 1 year ago
parent
commit
7214ef1f14
  1. 1
      common/CMakeLists.txt
  2. 15
      common/dialogs/dialog_plugin_options.cpp
  3. 6
      common/io/io_base.cpp
  4. 12
      common/lib_table_base.cpp
  5. 37
      common/string_utf8_map.cpp
  6. 2
      eeschema/cross-probing.cpp
  7. 4
      eeschema/dialogs/panel_sym_lib_table.cpp
  8. 2
      eeschema/files-io.cpp
  9. 2
      eeschema/project_rescue.cpp
  10. 3
      eeschema/project_rescue.h
  11. 2
      eeschema/sch_edit_frame.h
  12. 12
      eeschema/sch_io/altium/sch_io_altium.cpp
  13. 14
      eeschema/sch_io/altium/sch_io_altium.h
  14. 21
      eeschema/sch_io/cadstar/sch_io_cadstar_archive.cpp
  15. 12
      eeschema/sch_io/cadstar/sch_io_cadstar_archive.h
  16. 6
      eeschema/sch_io/database/sch_io_database.cpp
  17. 6
      eeschema/sch_io/database/sch_io_database.h
  18. 11
      eeschema/sch_io/eagle/sch_io_eagle.cpp
  19. 11
      eeschema/sch_io/eagle/sch_io_eagle.h
  20. 10
      eeschema/sch_io/easyeda/sch_io_easyeda.cpp
  21. 8
      eeschema/sch_io/easyeda/sch_io_easyeda.h
  22. 14
      eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp
  23. 8
      eeschema/sch_io/easyedapro/sch_io_easyedapro.h
  24. 8
      eeschema/sch_io/http_lib/sch_io_http_lib.cpp
  25. 8
      eeschema/sch_io/http_lib/sch_io_http_lib.h
  26. 30
      eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy.cpp
  27. 29
      eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy.h
  28. 28
      eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp
  29. 27
      eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.h
  30. 2
      eeschema/sch_io/ltspice/sch_io_ltspice.cpp
  31. 2
      eeschema/sch_io/ltspice/sch_io_ltspice.h
  32. 19
      eeschema/sch_io/sch_io.cpp
  33. 18
      eeschema/sch_io/sch_io.h
  34. 2
      eeschema/sch_io/sch_io_mgr.cpp
  35. 3
      eeschema/sch_io/sch_io_mgr.h
  36. 11
      eeschema/symbol_library.cpp
  37. 3
      eeschema/symbol_library.h
  38. 4
      eeschema/symbol_library_manager.cpp
  39. 7
      include/dialogs/dialog_plugin_options.h
  40. 10
      include/io/io_base.h
  41. 13
      include/lib_table_base.h
  42. 60
      include/string_utf8_map.h
  43. 6
      kicad/import_proj.h
  44. 3
      pcbnew/cross-probing.cpp
  45. 4
      pcbnew/dialogs/panel_fp_lib_table.cpp
  46. 3
      pcbnew/exporters/board_exporter_base.h
  47. 7
      pcbnew/files.cpp
  48. 4
      pcbnew/kicad_clipboard.cpp
  49. 4
      pcbnew/kicad_clipboard.h
  50. 5
      pcbnew/pcb_edit_frame.h
  51. 2
      pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp
  52. 2
      pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.h
  53. 2
      pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp
  54. 2
      pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.h
  55. 6
      pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp
  56. 6
      pcbnew/pcb_io/altium/pcb_io_altium_designer.h
  57. 2
      pcbnew/pcb_io/altium/pcb_io_solidworks.cpp
  58. 2
      pcbnew/pcb_io/altium/pcb_io_solidworks.h
  59. 18
      pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp
  60. 8
      pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.h
  61. 18
      pcbnew/pcb_io/eagle/pcb_io_eagle.cpp
  62. 8
      pcbnew/pcb_io/eagle/pcb_io_eagle.h
  63. 6
      pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp
  64. 6
      pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h
  65. 11
      pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.cpp
  66. 6
      pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.h
  67. 2
      pcbnew/pcb_io/fabmaster/pcb_io_fabmaster.cpp
  68. 2
      pcbnew/pcb_io/fabmaster/pcb_io_fabmaster.h
  69. 14
      pcbnew/pcb_io/geda/pcb_io_geda.cpp
  70. 14
      pcbnew/pcb_io/geda/pcb_io_geda.h
  71. 3
      pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp
  72. 6
      pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.h
  73. 11
      pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp
  74. 10
      pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.h
  75. 30
      pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp
  76. 28
      pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h
  77. 2
      pcbnew/pcb_io/pcad/pcb_io_pcad.cpp
  78. 2
      pcbnew/pcb_io/pcad/pcb_io_pcad.h
  79. 23
      pcbnew/pcb_io/pcb_io.cpp
  80. 25
      pcbnew/pcb_io/pcb_io.h
  81. 6
      pcbnew/pcb_io/pcb_io_mgr.cpp
  82. 7
      pcbnew/pcb_io/pcb_io_mgr.h
  83. 3
      pcbnew/pcbnew_jobs_handler.cpp
  84. 3
      pcbnew/tools/pcb_control.cpp
  85. 4
      thirdparty/pybind11/tools/pybind11Config.cmake.in

1
common/CMakeLists.txt

@ -570,7 +570,6 @@ set( COMMON_SRCS
reporter.cpp
scintilla_tricks.cpp
status_popup.cpp
string_utf8_map.cpp
stroke_params.cpp
template_fieldnames.cpp
textentry_tricks.cpp

15
common/dialogs/dialog_plugin_options.cpp

@ -39,7 +39,7 @@
DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
const wxString& aNickname,
const STRING_UTF8_MAP& aPluginOptions,
const std::map<std::string, UTF8>& aPluginOptions,
const wxString& aFormattedOptions,
wxString* aResult ) :
DIALOG_PLUGIN_OPTIONS_BASE( aParent ),
@ -64,7 +64,7 @@ DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS( wxWindow* aParent,
{
unsigned int row = 0;
for( STRING_UTF8_MAP::const_iterator it = m_choices.begin(); it != m_choices.end();
for( std::map<std::string, UTF8>::const_iterator it = m_choices.begin(); it != m_choices.end();
++it, ++row )
{
wxString item = From_UTF8( it->first.c_str() );
@ -101,7 +101,7 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataToWindow()
// Fill the grid with existing aOptions
std::string options = TO_UTF8( m_callers_options );
STRING_UTF8_MAP* props = LIB_TABLE::ParseOptions( options );
std::map<std::string, UTF8>* props = LIB_TABLE::ParseOptions( options );
if( props )
{
@ -110,7 +110,7 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataToWindow()
int row = 0;
for( STRING_UTF8_MAP::const_iterator it = props->begin(); it != props->end();
for( std::map<std::string, UTF8>::const_iterator it = props->begin(); it != props->end();
++it, ++row )
{
m_grid->SetCellValue( row, 0, From_UTF8( it->first.c_str() ) );
@ -132,7 +132,7 @@ bool DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow()
if( !DIALOG_SHIM::TransferDataFromWindow() )
return false;
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
const int rowCount = m_grid->GetNumberRows();
for( int row = 0; row<rowCount; ++row )
@ -200,10 +200,9 @@ void DIALOG_PLUGIN_OPTIONS::onListBoxItemSelected( wxCommandEvent& event )
if( event.IsSelection() )
{
std::string option = TO_UTF8( event.GetString() );
UTF8 help_text;
if( m_choices.Value( option.c_str(), &help_text ) )
m_html->SetPage( help_text );
if( auto it = m_choices.find( option ); it != m_choices.end() )
m_html->SetPage( it->second );
else
m_html->SetPage( m_initial_help );
}

6
common/io/io_base.cpp

@ -43,13 +43,13 @@ wxString IO_BASE::IO_FILE_DESC::FileFilter() const
}
void IO_BASE::CreateLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
void IO_BASE::CreateLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties )
{
NOT_IMPLEMENTED( __FUNCTION__ );
}
bool IO_BASE::DeleteLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
bool IO_BASE::DeleteLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties )
{
NOT_IMPLEMENTED( __FUNCTION__ );
}
@ -60,7 +60,7 @@ bool IO_BASE::IsLibraryWritable( const wxString& aLibraryPath )
NOT_IMPLEMENTED( __FUNCTION__ );
}
void IO_BASE::GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const
void IO_BASE::GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const
{
// No global options to append
}

12
common/lib_table_base.cpp

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

37
common/string_utf8_map.cpp

@ -1,37 +0,0 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2016 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string_utf8_map.h>
bool STRING_UTF8_MAP::Value( const char* aName, UTF8* aFetchedValue ) const
{
STRING_UTF8_MAP::const_iterator it = find( aName );
if( it != end() )
{
if( aFetchedValue )
*aFetchedValue = it->second;
return true;
}
return false;
}

2
eeschema/cross-probing.cpp

@ -966,7 +966,7 @@ void SCH_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
importFormat = -1;
}
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
do
{

4
eeschema/dialogs/panel_sym_lib_table.cpp

@ -163,7 +163,7 @@ protected:
LIB_TABLE_ROW* row = tbl->at( (size_t) aRow );
const wxString& options = row->GetOptions();
wxString result = options;
STRING_UTF8_MAP choices;
std::map<std::string, UTF8> choices;
SCH_IO_MGR::SCH_FILE_T pi_type = SCH_IO_MGR::EnumFromStr( row->GetType() );
IO_RELEASER<SCH_IO> pi( SCH_IO_MGR::FindPlugin( pi_type ) );
@ -975,7 +975,7 @@ void PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries( wxCommandEvent& event )
}
wxString options = m_cur_grid->GetCellValue( row, COL_OPTIONS );
std::unique_ptr<STRING_UTF8_MAP> props( LIB_TABLE::ParseOptions( options.ToStdString() ) );
std::unique_ptr<std::map<std::string, UTF8>> props( LIB_TABLE::ParseOptions( options.ToStdString() ) );
if( SCH_IO_MGR::ConvertLibrary( props.get(), legacyLib.GetFullPath(), newLib.GetFullPath() ) )
{

2
eeschema/files-io.cpp

@ -1376,7 +1376,7 @@ bool SCH_EDIT_FRAME::doAutoSave()
bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName filename( aFileName );
wxFileName newfilename;

2
eeschema/project_rescue.cpp

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

3
eeschema/project_rescue.h

@ -39,7 +39,6 @@
#include <wx/string.h>
#include <string_utf8_map.h>
#include <lib_symbol.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <class_draw_panel_gal.h>
@ -379,7 +378,7 @@ public:
private:
std::vector<std::unique_ptr<LIB_SYMBOL>> m_rescueLibSymbols;
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
std::unique_ptr<std::map<std::string, UTF8>> m_properties; ///< Library plugin properties.
};
#endif // _LIB_CACHE_RESCUE_H_

2
eeschema/sch_edit_frame.h

@ -984,7 +984,7 @@ private:
* @param aFileType SCH_FILE_T value for file type
*/
bool importFile( const wxString& aFileName, int aFileType,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Save \a aSheet to a schematic file.

12
eeschema/sch_io/altium/sch_io_altium.cpp

@ -383,7 +383,7 @@ wxFileName SCH_IO_ALTIUM::getLibFileName()
SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
@ -4515,7 +4515,7 @@ long long SCH_IO_ALTIUM::getLibraryTimestamp( const wxString& aLibraryPath ) con
void SCH_IO_ALTIUM::ensureLoadedLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
@ -4625,7 +4625,7 @@ void SCH_IO_ALTIUM::ParseLibHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFile,
void SCH_IO_ALTIUM::doEnumerateSymbolLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties,
const std::map<std::string, UTF8>* aProperties,
std::function<void(const wxString&, LIB_SYMBOL*)> aInserter )
{
ensureLoadedLibrary( aLibraryPath, aProperties );
@ -4651,7 +4651,7 @@ void SCH_IO_ALTIUM::doEnumerateSymbolLib( const wxString& aLibraryPath,
void SCH_IO_ALTIUM::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
doEnumerateSymbolLib( aLibraryPath, aProperties,
[&]( const wxString& aStr, LIB_SYMBOL* )
@ -4663,7 +4663,7 @@ void SCH_IO_ALTIUM::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_ALTIUM::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
doEnumerateSymbolLib( aLibraryPath, aProperties,
[&]( const wxString&, LIB_SYMBOL* aSymbol )
@ -4675,7 +4675,7 @@ void SCH_IO_ALTIUM::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_IO_ALTIUM::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath, aProperties );

14
eeschema/sch_io/altium/sch_io_altium.h

@ -77,7 +77,7 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
// unimplemented functions. Will trigger a not_implemented IO error.
//void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = NULL ) override;
@ -88,15 +88,15 @@ public:
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
//void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
// const PROPERTIES* aProperties = NULL ) override;
@ -180,7 +180,7 @@ private:
std::map<wxString,LIB_SYMBOL*> ParseLibFile( const ALTIUM_COMPOUND_FILE& aAltiumSchFile );
std::vector<LIB_SYMBOL*> ParseLibComponent( const std::map<wxString, wxString>& aProperties );
void doEnumerateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties,
void doEnumerateSymbolLib( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties,
std::function<void(const wxString&, LIB_SYMBOL*)> aInserter );
void fixupSymbolPinNameNumbers( SYMBOL* aSymbol );
@ -193,7 +193,7 @@ private:
bool m_isIntLib; // Flag to indicate Integrated Library
IO_RELEASER<SCH_IO> m_pi; // Plugin to create KiCad symbol library.
std::unique_ptr<STRING_UTF8_MAP> m_properties; // Library plugin properties.
std::unique_ptr<std::map<std::string, UTF8>> m_properties; // Library plugin properties.
std::unique_ptr<TITLE_BLOCK> m_currentTitleBlock; // Will be assigned at the end of parsing
// a sheet
@ -221,7 +221,7 @@ private:
int m_harnessEntryParent; // used to identify harness connector for harness entry element
// Symbol caching
void ensureLoadedLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties );
void ensureLoadedLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties );
long long getLibraryTimestamp( const wxString& aLibraryPath ) const;
static bool isBinaryFile( const wxString& aFileName );

21
eeschema/sch_io/cadstar/sch_io_cadstar_archive.cpp

@ -26,7 +26,6 @@
#include <lib_symbol.h>
#include <progress_reporter.h>
#include <project_sch.h>
#include <string_utf8_map.h>
#include <sch_screen.h>
#include <sch_sheet.h>
#include <schematic.h>
@ -65,7 +64,7 @@ int SCH_IO_CADSTAR_ARCHIVE::GetModifyHash() const
SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFileName,
SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
@ -136,7 +135,7 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
}
// set properties to prevent save file on every symbol save
STRING_UTF8_MAP properties;
std::map<std::string, UTF8> properties;
properties.emplace( SCH_IO_KICAD_SEXPR::PropBuffering, "" );
for( LIB_SYMBOL* const& symbol : csaLoader.GetLoadedSymbols() )
@ -169,7 +168,7 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi
void SCH_IO_CADSTAR_ARCHIVE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath, aProperties );
@ -180,7 +179,7 @@ void SCH_IO_CADSTAR_ARCHIVE::EnumerateSymbolLib( wxArrayString& aSymbolN
void SCH_IO_CADSTAR_ARCHIVE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath, aProperties );
@ -191,7 +190,7 @@ void SCH_IO_CADSTAR_ARCHIVE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymb
LIB_SYMBOL* SCH_IO_CADSTAR_ARCHIVE::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath, aProperties );
@ -224,7 +223,7 @@ void SCH_IO_CADSTAR_ARCHIVE::GetAvailableSymbolFields( std::vector<wxString>& aN
}
void SCH_IO_CADSTAR_ARCHIVE::GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const
void SCH_IO_CADSTAR_ARCHIVE::GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const
{
( *aListToAppendTo )["csa"] =
UTF8( _( "Path to the CADSTAR schematic archive (*.csa) file related to this CADSTAR "
@ -239,7 +238,7 @@ void SCH_IO_CADSTAR_ARCHIVE::GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo
void SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName csafn;
wxString fplibname = "cadstarpcblib";
@ -247,7 +246,7 @@ void SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath,
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
if( aProperties && aProperties->count( "csa" ) )
if( aProperties && aProperties->contains( "csa" ) )
{
csafn = wxFileName( aProperties->at( "csa" ) );
@ -286,9 +285,9 @@ void SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath,
}
}
if( aProperties && aProperties->count( "fplib" ) )
if( aProperties && aProperties->contains( "fplib" ) )
{
fplibname = aProperties->at( "fplib" ).wx_str();
fplibname = aProperties->at( "fplib" );
}
// Get timestamp

12
eeschema/sch_io/cadstar/sch_io_cadstar_archive.h

@ -68,18 +68,18 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void GetAvailableSymbolFields( std::vector<wxString>& aNames ) override;
@ -87,11 +87,11 @@ public:
// Writing to CADSTAR libraries is not supported
bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
void GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const override;
void GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const override;
private:
// Symbol caching
void ensureLoadedLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties );
void ensureLoadedLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties );
typedef std::map<const wxString, std::unique_ptr<LIB_SYMBOL>> NAME_TO_SYMBOL_MAP;

6
eeschema/sch_io/database/sch_io_database.cpp

@ -51,7 +51,7 @@ SCH_IO_DATABASE::~SCH_IO_DATABASE()
void SCH_IO_DATABASE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
std::vector<LIB_SYMBOL*> symbols;
EnumerateSymbolLib( symbols, aLibraryPath, aProperties );
@ -63,7 +63,7 @@ void SCH_IO_DATABASE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_DATABASE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK_RET( m_libTable, "Database plugin missing library table handle!" );
ensureSettings( aLibraryPath );
@ -89,7 +89,7 @@ void SCH_IO_DATABASE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_IO_DATABASE::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK( m_libTable, nullptr );
ensureSettings( aLibraryPath );

6
eeschema/sch_io/database/sch_io_database.h

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

11
eeschema/sch_io/eagle/sch_io_eagle.cpp

@ -25,7 +25,6 @@
#include <sch_io/eagle/sch_io_eagle.h>
#include <locale_io.h>
#include <string_utf8_map.h>
#include <algorithm>
#include <memory>
@ -340,7 +339,7 @@ int SCH_IO_EAGLE::GetModifyHash() const
SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxASSERT( !aFileName || aSchematic != nullptr );
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -403,7 +402,7 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC
wxCHECK_MSG( libTable, nullptr, wxT( "Could not load symbol lib table." ) );
m_pi.reset( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
m_properties = std::make_unique<STRING_UTF8_MAP>();
m_properties = std::make_unique<std::map<std::string, UTF8>>();
( *m_properties )[SCH_IO_KICAD_LEGACY::PropBuffering] = "";
/// @note No check is being done here to see if the existing symbol library exists so this
@ -453,7 +452,7 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC
void SCH_IO_EAGLE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
m_filename = aLibraryPath;
m_libName = m_filename.GetName();
@ -472,7 +471,7 @@ void SCH_IO_EAGLE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_EAGLE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
m_filename = aLibraryPath;
m_libName = m_filename.GetName();
@ -490,7 +489,7 @@ void SCH_IO_EAGLE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_IO_EAGLE::LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
m_filename = aLibraryPath;
m_libName = m_filename.GetName();

11
eeschema/sch_io/eagle/sch_io_eagle.h

@ -47,7 +47,6 @@ class SCH_TEXT;
class SCH_GLOBALLABEL;
class SCH_SYMBOL;
class SCH_FIELD;
class STRING_UTF8_MAP;
class LIB_SYMBOL;
class SYMBOL_LIB;
class SCH_PIN;
@ -101,16 +100,16 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties ) override;
const std::map<std::string, UTF8>* aProperties ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties ) override;
const std::map<std::string, UTF8>* aProperties ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties ) override;
const std::map<std::string, UTF8>* aProperties ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
@ -263,7 +262,7 @@ private:
std::unordered_map<wxString, bool> m_userValue; ///< deviceset/@uservalue for device.
IO_RELEASER<SCH_IO> m_pi; ///< PI to create KiCad symbol library.
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
std::unique_ptr<std::map<std::string, UTF8>> m_properties; ///< Library plugin properties.
int m_sheetIndex;

10
eeschema/sch_io/easyeda/sch_io_easyeda.cpp

@ -130,7 +130,7 @@ int SCH_IO_EASYEDA::GetModifyHash() const
LIB_SYMBOL* loadSymbol( const wxString& aLibraryPath, nlohmann::json aFileData,
const wxString& aAliasName, const STRING_UTF8_MAP* aProperties )
const wxString& aAliasName, const std::map<std::string, UTF8>* aProperties )
{
SCH_EASYEDA_PARSER parser( nullptr, nullptr );
std::map<wxString, int> namesCounter;
@ -305,7 +305,7 @@ LIB_SYMBOL* loadSymbol( const wxString& aLibraryPath, nlohmann::json aFileData,
void SCH_IO_EASYEDA::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
std::map<wxString, int> namesCounter;
@ -431,7 +431,7 @@ void SCH_IO_EASYEDA::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_EASYEDA::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFFileInputStream in( aLibraryPath );
nlohmann::json js;
@ -473,7 +473,7 @@ void SCH_IO_EASYEDA::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_IO_EASYEDA::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
try
{
@ -611,7 +611,7 @@ static void LoadSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet, const w
SCH_SHEET* SCH_IO_EASYEDA::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );

8
eeschema/sch_io/easyeda/sch_io_easyeda.h

@ -60,16 +60,16 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
};

14
eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp

@ -105,7 +105,7 @@ int SCH_IO_EASYEDAPRO::GetModifyHash() const
static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryPath,
const wxString& aAliasName, const STRING_UTF8_MAP* aProperties )
const wxString& aAliasName, const std::map<std::string, UTF8>* aProperties )
{
SCH_EASYEDAPRO_PARSER parser( nullptr, nullptr );
LIB_SYMBOL* symbol = nullptr;
@ -241,7 +241,7 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
void SCH_IO_EASYEDAPRO::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName fname( aLibraryPath );
@ -287,7 +287,7 @@ void SCH_IO_EASYEDAPRO::EnumerateSymbolLib( wxArrayString& aSymbolNameLi
void SCH_IO_EASYEDAPRO::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName libFname( aLibraryPath );
wxArrayString symbolNameList;
@ -409,7 +409,7 @@ void SCH_IO_EASYEDAPRO::LoadAllDataFromProject( const wxString& aProjectPath )
LIB_SYMBOL* SCH_IO_EASYEDAPRO::LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName libFname( aLibraryPath );
nlohmann::json project;
@ -426,7 +426,7 @@ LIB_SYMBOL* SCH_IO_EASYEDAPRO::LoadSymbol( const wxString& aLibraryPath, const w
SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
SCHEMATIC* aSchematic, SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
@ -475,7 +475,7 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
wxString schematicToLoad;
if( aProperties && aProperties->Exists( "sch_id" ) )
if( aProperties && aProperties->contains( "sch_id" ) )
{
schematicToLoad = wxString::FromUTF8( aProperties->at( "sch_id" ) );
}
@ -627,7 +627,7 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
}
// set properties to prevent save file on every symbol save
STRING_UTF8_MAP properties;
std::map<std::string, UTF8> properties;
properties.emplace( SCH_IO_KICAD_SEXPR::PropBuffering, wxEmptyString );
for( auto& [symbolUuid, symInfo] : m_projectData->m_Symbols )

8
eeschema/sch_io/easyedapro/sch_io_easyedapro.h

@ -57,18 +57,18 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void LoadAllDataFromProject( const wxString& aLibraryPath );
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }

8
eeschema/sch_io/http_lib/sch_io_http_lib.cpp

@ -41,7 +41,7 @@ SCH_IO_HTTP_LIB::~SCH_IO_HTTP_LIB()
void SCH_IO_HTTP_LIB::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
std::vector<LIB_SYMBOL*> symbols;
EnumerateSymbolLib( symbols, aLibraryPath, aProperties );
@ -53,7 +53,7 @@ void SCH_IO_HTTP_LIB::EnumerateSymbolLib( wxArrayString& aSymbolNameList
void SCH_IO_HTTP_LIB::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK_RET( m_libTable, _( "httplib plugin missing library table handle!" ) );
ensureSettings( aLibraryPath );
@ -103,7 +103,7 @@ void SCH_IO_HTTP_LIB::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_IO_HTTP_LIB::LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK( m_libTable, nullptr );
ensureSettings( aLibraryPath );
@ -501,7 +501,7 @@ LIB_SYMBOL* SCH_IO_HTTP_LIB::loadSymbolFromPart( const wxString& aSymbo
}
void SCH_IO_HTTP_LIB::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// TODO: Implement this sometime;
}

8
eeschema/sch_io/http_lib/sch_io_http_lib.h

@ -50,13 +50,13 @@ public:
int GetModifyHash() const override { return 0; }
void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool SupportsSubLibraries() const override { return true; }
@ -75,7 +75,7 @@ public:
HTTP_LIB_SETTINGS* Settings() const { return m_settings.get(); }
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
const wxString& GetError() const override { return m_lastError; }

30
eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy.cpp

@ -88,7 +88,7 @@ SCH_IO_KICAD_LEGACY::~SCH_IO_KICAD_LEGACY()
}
void SCH_IO_KICAD_LEGACY::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_LEGACY::init( SCHEMATIC* aSchematic, const std::map<std::string, UTF8>* aProperties )
{
m_version = 0;
m_rootSheet = nullptr;
@ -123,7 +123,7 @@ void SCH_IO_KICAD_LEGACY::checkpoint()
SCH_SHEET* SCH_IO_KICAD_LEGACY::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxASSERT( !aFileName || aSchematic != nullptr );
@ -1503,7 +1503,7 @@ std::shared_ptr<BUS_ALIAS> SCH_IO_KICAD_LEGACY::loadBusAlias( LINE_READER& aRead
void SCH_IO_KICAD_LEGACY::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
@ -2098,7 +2098,7 @@ void SCH_IO_KICAD_LEGACY::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
void SCH_IO_KICAD_LEGACY::cacheLib( const wxString& aLibraryFileName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{
@ -2112,7 +2112,7 @@ void SCH_IO_KICAD_LEGACY::cacheLib( const wxString& aLibraryFileName,
}
bool SCH_IO_KICAD_LEGACY::writeDocFile( const STRING_UTF8_MAP* aProperties )
bool SCH_IO_KICAD_LEGACY::writeDocFile( const std::map<std::string, UTF8>* aProperties )
{
std::string propName( SCH_IO_KICAD_LEGACY::PropNoDocFile );
@ -2123,9 +2123,9 @@ bool SCH_IO_KICAD_LEGACY::writeDocFile( const STRING_UTF8_MAP* aProperties )
}
bool SCH_IO_KICAD_LEGACY::isBuffering( const STRING_UTF8_MAP* aProperties )
bool SCH_IO_KICAD_LEGACY::isBuffering( const std::map<std::string, UTF8>* aProperties )
{
return ( aProperties && aProperties->Exists( SCH_IO_KICAD_LEGACY::PropBuffering ) );
return ( aProperties && aProperties->contains( SCH_IO_KICAD_LEGACY::PropBuffering ) );
}
@ -2141,7 +2141,7 @@ int SCH_IO_KICAD_LEGACY::GetModifyHash() const
void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2162,7 +2162,7 @@ void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2183,7 +2183,7 @@ void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolL
LIB_SYMBOL* SCH_IO_KICAD_LEGACY::LoadSymbol( const wxString& aLibraryPath,
const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2199,7 +2199,7 @@ LIB_SYMBOL* SCH_IO_KICAD_LEGACY::LoadSymbol( const wxString& aLibraryPath,
void SCH_IO_KICAD_LEGACY::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2213,7 +2213,7 @@ void SCH_IO_KICAD_LEGACY::SaveSymbol( const wxString& aLibraryPath, const LIB_SY
void SCH_IO_KICAD_LEGACY::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2227,7 +2227,7 @@ void SCH_IO_KICAD_LEGACY::DeleteSymbol( const wxString& aLibraryPath, const wxSt
void SCH_IO_KICAD_LEGACY::CreateLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
if( wxFileExists( aLibraryPath ) )
{
@ -2246,7 +2246,7 @@ void SCH_IO_KICAD_LEGACY::CreateLibrary( const wxString& aLibraryPath,
bool SCH_IO_KICAD_LEGACY::DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName fn = aLibraryPath;
@ -2272,7 +2272,7 @@ bool SCH_IO_KICAD_LEGACY::DeleteLibrary( const wxString& aLibraryPath,
void SCH_IO_KICAD_LEGACY::SaveLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
if( !m_cache )
m_cache = new SCH_IO_KICAD_LEGACY_LIB_CACHE( aLibraryPath );

29
eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy.h

@ -43,7 +43,6 @@ class SCH_BUS_ENTRY_BASE;
class SCH_TEXT;
class SCH_SYMBOL;
class SCH_FIELD;
class STRING_UTF8_MAP;
class SELECTION;
class SCH_IO_KICAD_LEGACY_LIB_CACHE;
class LIB_SYMBOL;
@ -103,13 +102,13 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen,
int version = EESCHEMA_VERSION );
void SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aScreen, SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void Format( SCH_SHEET* aSheet );
@ -117,22 +116,22 @@ public:
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void CreateLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void SaveLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override;
@ -169,9 +168,9 @@ private:
void saveText( SCH_TEXT* aText );
void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias );
void cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties );
bool writeDocFile( const STRING_UTF8_MAP* aProperties );
bool isBuffering( const STRING_UTF8_MAP* aProperties );
void cacheLib( const wxString& aLibraryFileName, const std::map<std::string, UTF8>* aProperties );
bool writeDocFile( const std::map<std::string, UTF8>* aProperties );
bool isBuffering( const std::map<std::string, UTF8>* aProperties );
protected:
int m_version; ///< Version of file being loaded.
@ -194,7 +193,7 @@ protected:
SCHEMATIC* m_schematic;
/// initialize PLUGIN like a constructor would.
void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
void init( SCHEMATIC* aSchematic, const std::map<std::string, UTF8>* aProperties = nullptr );
};
#endif // SCH_IO_KICAD_LEGACY_H_

28
eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp

@ -86,7 +86,7 @@ SCH_IO_KICAD_SEXPR::~SCH_IO_KICAD_SEXPR()
}
void SCH_IO_KICAD_SEXPR::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_SEXPR::init( SCHEMATIC* aSchematic, const std::map<std::string, UTF8>* aProperties )
{
m_version = 0;
m_appending = false;
@ -100,7 +100,7 @@ void SCH_IO_KICAD_SEXPR::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aPr
SCH_SHEET* SCH_IO_KICAD_SEXPR::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxASSERT( !aFileName || aSchematic != nullptr );
@ -336,7 +336,7 @@ void SCH_IO_KICAD_SEXPR::LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet, i
void SCH_IO_KICAD_SEXPR::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
@ -1603,7 +1603,7 @@ void SCH_IO_KICAD_SEXPR::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& a
void SCH_IO_KICAD_SEXPR::cacheLib( const wxString& aLibraryFileName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// Suppress font substitution warnings
fontconfig::FONTCONFIG::SetReporter( nullptr );
@ -1620,9 +1620,9 @@ void SCH_IO_KICAD_SEXPR::cacheLib( const wxString& aLibraryFileName,
}
bool SCH_IO_KICAD_SEXPR::isBuffering( const STRING_UTF8_MAP* aProperties )
bool SCH_IO_KICAD_SEXPR::isBuffering( const std::map<std::string, UTF8>* aProperties )
{
return ( aProperties && aProperties->Exists( SCH_IO_KICAD_SEXPR::PropBuffering ) );
return ( aProperties && aProperties->contains( SCH_IO_KICAD_SEXPR::PropBuffering ) );
}
@ -1638,7 +1638,7 @@ int SCH_IO_KICAD_SEXPR::GetModifyHash() const
void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1659,7 +1659,7 @@ void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1680,7 +1680,7 @@ void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLi
LIB_SYMBOL* SCH_IO_KICAD_SEXPR::LoadSymbol( const wxString& aLibraryPath,
const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1707,7 +1707,7 @@ LIB_SYMBOL* SCH_IO_KICAD_SEXPR::LoadSymbol( const wxString& aLibraryPath,
void SCH_IO_KICAD_SEXPR::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1721,7 +1721,7 @@ void SCH_IO_KICAD_SEXPR::SaveSymbol( const wxString& aLibraryPath, const LIB_SYM
void SCH_IO_KICAD_SEXPR::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1735,7 +1735,7 @@ void SCH_IO_KICAD_SEXPR::DeleteSymbol( const wxString& aLibraryPath, const wxStr
void SCH_IO_KICAD_SEXPR::CreateLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
if( wxFileExists( aLibraryPath ) )
{
@ -1754,7 +1754,7 @@ void SCH_IO_KICAD_SEXPR::CreateLibrary( const wxString& aLibraryPath,
bool SCH_IO_KICAD_SEXPR::DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName fn = aLibraryPath;
@ -1780,7 +1780,7 @@ bool SCH_IO_KICAD_SEXPR::DeleteLibrary( const wxString& aLibraryPath,
void SCH_IO_KICAD_SEXPR::SaveLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
if( !m_cache )
m_cache = new SCH_IO_KICAD_SEXPR_LIB_CACHE( aLibraryPath );

27
eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.h

@ -51,7 +51,6 @@ class SCH_TABLE;
class SCH_SYMBOL;
class SCH_FIELD;
struct SCH_SYMBOL_INSTANCE;
class STRING_UTF8_MAP;
class EE_SELECTION;
class SCH_IO_KICAD_SEXPR_LIB_CACHE;
class LIB_SYMBOL;
@ -94,13 +93,13 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet,
int aVersion = SEXPR_SCHEMATIC_FILE_VERSION );
void SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void Format( SCH_SHEET* aSheet );
@ -109,22 +108,22 @@ public:
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void CreateLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void SaveLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override;
@ -160,8 +159,8 @@ private:
void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNestLevel );
void saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aSheets, int aNestLevel );
void cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties );
bool isBuffering( const STRING_UTF8_MAP* aProperties );
void cacheLib( const wxString& aLibraryFileName, const std::map<std::string, UTF8>* aProperties );
bool isBuffering( const std::map<std::string, UTF8>* aProperties );
protected:
int m_version; ///< Version of file being loaded.
@ -179,7 +178,7 @@ protected:
SCH_IO_KICAD_SEXPR_LIB_CACHE* m_cache;
/// initialize PLUGIN like a constructor would.
void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
void init( SCHEMATIC* aSchematic, const std::map<std::string, UTF8>* aProperties = nullptr );
};
#endif // SCH_IO_KICAD_SEXPR_H_

2
eeschema/sch_io/ltspice/sch_io_ltspice.cpp

@ -41,7 +41,7 @@ int SCH_IO_LTSPICE::GetModifyHash() const
SCH_SHEET* SCH_IO_LTSPICE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxASSERT( !aFileName || aSchematic );

2
eeschema/sch_io/ltspice/sch_io_ltspice.h

@ -60,7 +60,7 @@ public:
SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
};
#endif // SCH_IO_LTSPICE_H_

19
eeschema/sch_io/sch_io.cpp

@ -20,7 +20,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string_utf8_map.h>
#include <unordered_set>
#include <ki_exception.h>
@ -59,21 +58,21 @@ bool SCH_IO::CanReadSchematicFile( const wxString& aFileName ) const
}
void SCH_IO::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
void SCH_IO::SaveLibrary( const wxString& aFileName, const std::map<std::string, UTF8>* aProperties )
{
NOT_IMPLEMENTED( __FUNCTION__ );
}
SCH_SHEET* SCH_IO::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
SCH_SHEET* aAppendToMe, const std::map<std::string, UTF8>* aProperties )
{
NOT_IMPLEMENTED( __FUNCTION__ );
}
void SCH_IO::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -82,7 +81,7 @@ void SCH_IO::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SC
void SCH_IO::EnumerateSymbolLib( wxArrayString& aAliasNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -91,7 +90,7 @@ void SCH_IO::EnumerateSymbolLib( wxArrayString& aAliasNameList,
void SCH_IO::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -99,7 +98,7 @@ void SCH_IO::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
LIB_SYMBOL* SCH_IO::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -107,7 +106,7 @@ LIB_SYMBOL* SCH_IO::LoadSymbol( const wxString& aLibraryPath, const wxString& aS
void SCH_IO::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -115,14 +114,14 @@ void SCH_IO::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol
void SCH_IO::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
NOT_IMPLEMENTED( __FUNCTION__ );
}
void SCH_IO::GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const
void SCH_IO::GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const
{
// Get base options first
IO_BASE::GetLibraryOptions( aListToAppendTo );

18
eeschema/sch_io/sch_io.h

@ -82,7 +82,7 @@ public:
virtual int GetModifyHash() const = 0;
virtual void SaveLibrary( const wxString& aFileName,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Load information from some input file format that this #SCH_IO implementation
@ -114,7 +114,7 @@ public:
*/
virtual SCH_SHEET* LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe = nullptr,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Write \a aSchematic to a storage file in a format that this #SCH_IO implementation
@ -143,7 +143,7 @@ public:
*/
virtual void SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Populate a list of #LIB_SYMBOL alias names contained within the library \a aLibraryPath.
@ -162,7 +162,7 @@ public:
* @throw IO_ERROR if the library cannot be found, the part library cannot be loaded.
*/
virtual void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Populate a list of #LIB_SYMBOL aliases contained within the library \a aLibraryPath.
@ -185,7 +185,7 @@ public:
*/
virtual void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Load a #LIB_SYMBOL object having \a aPartName from the \a aLibraryPath containing
@ -209,7 +209,7 @@ public:
* is thrown in the case where aAliasName cannot be found.
*/
virtual LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aPartName,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Write \a aSymbol to an existing library located at \a aLibraryPath. If a #LIB_SYMBOL
@ -233,7 +233,7 @@ public:
* @throw IO_ERROR if there is a problem saving.
*/
virtual void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Delete the entire #LIB_SYMBOL associated with \a aAliasName from the library
@ -254,7 +254,7 @@ public:
* @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,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Append supported #SCH_IO options to \a aListToAppenTo along with internationalized
@ -280,7 +280,7 @@ public:
* This would require a 3 column list, and introducing wx GUI knowledge to
* #SCH_IO, which has been avoided to date.
*/
virtual void GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const override;
virtual void GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const override;
/**
* @return true if this plugin supports libraries that contain sub-libraries.

2
eeschema/sch_io/sch_io_mgr.cpp

@ -188,7 +188,7 @@ SCH_IO_MGR::SCH_FILE_T SCH_IO_MGR::GuessPluginTypeFromSchPath( const wxString& a
}
bool SCH_IO_MGR::ConvertLibrary( STRING_UTF8_MAP* aOldFileProps, const wxString& aOldFilePath,
bool SCH_IO_MGR::ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, const wxString& aOldFilePath,
const wxString& aNewFilepath )
{
SCH_IO_MGR::SCH_FILE_T oldFileType = SCH_IO_MGR::GuessPluginTypeFromLibPath( aOldFilePath );

3
eeschema/sch_io/sch_io_mgr.h

@ -41,7 +41,6 @@ class SYMBOL_LIB_TABLE;
class KIWAY;
class LIB_SYMBOL;
class SYMBOL_LIB;
class STRING_UTF8_MAP;
class PROGRESS_REPORTER;
@ -110,7 +109,7 @@ public:
/**
* Convert a schematic symbol library to the latest KiCad format
*/
static bool ConvertLibrary( STRING_UTF8_MAP* aOldFileProps, const wxString& aOldFilePath,
static bool ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, const wxString& aOldFilePath,
const wxString& aNewFilepath );
};

11
eeschema/symbol_library.cpp

@ -34,7 +34,6 @@
#include <project/project_file.h>
#include <project_rescue.h>
#include <project_sch.h>
#include <string_utf8_map.h>
#include <widgets/app_progress_dialog.h>
#include <symbol_library.h>
@ -62,7 +61,7 @@ SYMBOL_LIB::SYMBOL_LIB( SCH_LIB_TYPE aType, const wxString& aFileName,
fileName = "unnamed.lib";
m_plugin.reset( SCH_IO_MGR::FindPlugin( m_pluginType ) );
m_properties = std::make_unique<STRING_UTF8_MAP>();
m_properties = std::make_unique<std::map<std::string, UTF8>>();
m_mod_hash = 0;
}
@ -78,7 +77,7 @@ void SYMBOL_LIB::Save( bool aSaveDocFile )
wxString::Format( wxT( "no plugin defined for library `%s`." ),
fileName.GetFullPath() ) );
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
if( !aSaveDocFile )
props[ SCH_IO_KICAD_LEGACY::PropNoDocFile ] = "";
@ -111,7 +110,7 @@ void SYMBOL_LIB::SetPluginType( SCH_IO_MGR::SCH_FILE_T aPluginType )
bool SYMBOL_LIB::IsCache() const
{
return m_properties->Exists( SCH_IO_KICAD_LEGACY::PropNoDocFile );
return m_properties->contains( SCH_IO_KICAD_LEGACY::PropNoDocFile );
}
@ -123,7 +122,7 @@ void SYMBOL_LIB::SetCache()
bool SYMBOL_LIB::IsBuffering() const
{
return m_properties->Exists( SCH_IO_KICAD_LEGACY::PropBuffering );
return m_properties->contains( SCH_IO_KICAD_LEGACY::PropBuffering );
}
@ -132,7 +131,7 @@ void SYMBOL_LIB::EnableBuffering( bool aEnable )
if( aEnable )
(*m_properties)[ SCH_IO_KICAD_LEGACY::PropBuffering ] = "";
else
m_properties->Clear( SCH_IO_KICAD_LEGACY::PropBuffering );
m_properties->erase( SCH_IO_KICAD_LEGACY::PropBuffering );
}

3
eeschema/symbol_library.h

@ -44,7 +44,6 @@ class LIB_SYMBOL;
class LIB_ID;
class LINE_READER;
class OUTPUTFORMATTER;
class STRING_UTF8_MAP;
class SCH_IO;
class SYMBOL_LIB;
@ -324,7 +323,7 @@ private:
SCH_IO_MGR::SCH_FILE_T m_pluginType;
std::unique_ptr< SCH_IO > m_plugin;
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library properties
std::unique_ptr<std::map<std::string, UTF8>> m_properties; ///< Library properties
};

4
eeschema/symbol_library_manager.cpp

@ -174,7 +174,7 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
IO_RELEASER<SCH_IO> pi( SCH_IO_MGR::FindPlugin( aFileType ) );
bool res = true; // assume all libraries are successfully saved
STRING_UTF8_MAP properties;
std::map<std::string, UTF8> properties;
properties.emplace( SCH_IO_KICAD_LEGACY::PropBuffering, "" );
@ -996,7 +996,7 @@ bool LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFFER> aSymbolBuf,
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
// Set properties to prevent saving the file on every symbol save.
STRING_UTF8_MAP properties;
std::map<std::string, UTF8> properties;
properties.emplace( SCH_IO_KICAD_LEGACY::PropBuffering, "" );
std::shared_ptr<SYMBOL_BUFFER>& symbolBuf = aSymbolBuf;

7
include/dialogs/dialog_plugin_options.h

@ -22,8 +22,7 @@
#define _DIALOG_PLUGIN_OPTIONS_H_
#include <dialog_plugin_options_base.h>
#include <string_utf8_map.h>
#include <core/utf8.h>
/**
* DIALOG_PLUGIN_OPTIONS
* is an options editor in the form of a two column name/value
@ -33,7 +32,7 @@ class DIALOG_PLUGIN_OPTIONS : public DIALOG_PLUGIN_OPTIONS_BASE
{
public:
DIALOG_PLUGIN_OPTIONS( wxWindow* aParent, const wxString& aNickname,
const STRING_UTF8_MAP& aPluginOptions, const wxString& aFormattedOptions,
const std::map<std::string, UTF8>& aPluginOptions, const wxString& aFormattedOptions,
wxString* aResult );
~DIALOG_PLUGIN_OPTIONS() override;
@ -45,7 +44,7 @@ public:
private:
const wxString& m_callers_options;
wxString* m_result;
STRING_UTF8_MAP m_choices;
std::map<std::string, UTF8> m_choices;
wxString m_initial_help;
bool m_grid_widths_dirty;

10
include/io/io_base.h

@ -21,14 +21,16 @@
#ifndef IO_BASE_H_
#define IO_BASE_H_
#include <map>
#include <vector>
#include <string>
#include <core/utf8.h>
#include <wx/string.h>
#include <widgets/report_severity.h>
class REPORTER;
class PROGRESS_REPORTER;
class STRING_UTF8_MAP;
class IO_BASE
{
@ -128,7 +130,7 @@ public:
* @throw IO_ERROR if there is a problem finding the library, or creating it.
*/
virtual void CreateLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Delete an existing library and returns true, or if library does not
@ -148,7 +150,7 @@ public:
* @throw IO_ERROR if there is a problem deleting an existing library.
*/
virtual bool DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Return true if the library at @a aLibraryPath is writable.
@ -186,7 +188,7 @@ public:
* This would require a 3 column list, and introducing wx GUI knowledge to
* #SCH_IO, which has been avoided to date.
*/
virtual void GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const;
virtual void GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const;
virtual void Report( const wxString& aText, SEVERITY aSeverity = RPT_SEVERITY_UNDEFINED );

13
include/lib_table_base.h

@ -32,7 +32,6 @@
#include <mutex>
#include <shared_mutex>
#include <project.h>
#include <string_utf8_map.h>
#include <richio.h>
#include <kicommon.h>
@ -191,7 +190,7 @@ public:
* Return the constant #PROPERTIES for this library (#LIB_TABLE_ROW). These are
* the "options" in a table.
*/
const STRING_UTF8_MAP* GetProperties() const { return properties.get(); }
const std::map<std::string, UTF8>* GetProperties() const { return properties.get(); }
/**
* Serialize this object as utf8 text to an #OUTPUTFORMATTER, and tries to
@ -220,7 +219,7 @@ protected:
m_parent( aRow.m_parent )
{
if( aRow.properties )
properties = std::make_unique<STRING_UTF8_MAP>( *aRow.properties.get() );
properties = std::make_unique<std::map<std::string, UTF8>>( *aRow.properties.get() );
else
properties.reset();
}
@ -230,7 +229,7 @@ protected:
private:
virtual LIB_TABLE_ROW* do_clone() const = 0;
void setProperties( STRING_UTF8_MAP* aProperties );
void setProperties( std::map<std::string, UTF8>* aProperties );
wxString nickName;
wxString uri_user; ///< what user entered from UI or loaded from disk
@ -242,7 +241,7 @@ private:
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)
std::unique_ptr<STRING_UTF8_MAP> properties;
std::unique_ptr<std::map<std::string, UTF8>> properties;
std::mutex m_loadMutex;
};
@ -502,7 +501,7 @@ public:
* a library table, this formatting is handled for you.
* </p>
*/
static STRING_UTF8_MAP* ParseOptions( const std::string& aOptionsList );
static std::map<std::string, UTF8>* ParseOptions( const std::string& aOptionsList );
/**
* Returns a list of options from the aProperties parameter.
@ -514,7 +513,7 @@ public:
* @param aProperties is the PROPERTIES to format or NULL. If NULL the returned
* string will be empty.
*/
static UTF8 FormatOptions( const STRING_UTF8_MAP* aProperties );
static UTF8 FormatOptions( const std::map<std::string, UTF8>* aProperties );
/**
* Returns the version number (0 if unset)

60
include/string_utf8_map.h

@ -1,60 +0,0 @@
#ifndef _PROPERTIES_H_
#define _PROPERTIES_H_
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string>
#include <map>
#include <core/utf8.h>
/**
* A name/value tuple with unique names and optional values. The names
* may be iterated alphabetically.
*/
class STRING_UTF8_MAP : public std::map< std::string, UTF8 >
{
public:
bool Clear( const std::string& aProperty )
{
return erase( aProperty ) > 0;
}
bool Exists( const std::string& aProperty ) const
{
return count( aProperty ) > 0;
}
/**
* Fetch a property by \a aName and returns true if that property was found, else false.
* If not found, \a aFetchedValue is not touched.
*
* @param aName is the property or option to look for.
* @param aFetchedValue is where to put the value of the property if it exists and
* \a aFetchedValue is not NULL.
* @return true if property is found, else false.
*/
bool Value( const char* aName, UTF8* aFetchedValue = nullptr ) const;
};
#endif // _PROPERTIES_H_
// LocalWords: aName aFetchedValue

6
kicad/import_proj.h

@ -3,7 +3,9 @@
#include <wx/filename.h>
#include <core/typeinfo.h>
#include <string_utf8_map.h>
#include <core/utf8.h>
#include <map>
class KICAD_MANAGER_FRAME;
@ -37,7 +39,7 @@ public:
private:
KICAD_MANAGER_FRAME* m_frame;
STRING_UTF8_MAP m_properties;
std::map<std::string, UTF8> m_properties;
std::vector<wxString> m_copiedSchPaths;
std::vector<wxString> m_copiedPcbPaths;

3
pcbnew/cross-probing.cpp

@ -49,7 +49,6 @@
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <render_settings.h>
#include <string_utf8_map.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_selection_tool.h>
@ -693,7 +692,7 @@ void PCB_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
importFormat = -1;
}
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
std::string key, value;
do

4
pcbnew/dialogs/panel_fp_lib_table.cpp

@ -236,7 +236,7 @@ protected:
LIB_TABLE_ROW* row = tbl->at( (size_t) aRow );
const wxString& options = row->GetOptions();
wxString result = options;
STRING_UTF8_MAP choices;
std::map<std::string, UTF8> choices;
PCB_IO_MGR::PCB_FILE_T pi_type = PCB_IO_MGR::EnumFromStr( row->GetType() );
IO_RELEASER<PCB_IO> pi( PCB_IO_MGR::PluginFind( pi_type ) );
@ -885,7 +885,7 @@ void PANEL_FP_LIB_TABLE::onMigrateLibraries( wxCommandEvent& event )
}
wxString options = m_cur_grid->GetCellValue( row, COL_OPTIONS );
std::unique_ptr<STRING_UTF8_MAP> props( LIB_TABLE::ParseOptions( options.ToStdString() ) );
std::unique_ptr<std::map<std::string, UTF8>> props( LIB_TABLE::ParseOptions( options.ToStdString() ) );
if( PCB_IO_MGR::ConvertLibrary( props.get(), legacyLib.GetFullPath(),
newLib.GetFullPath(), errorReporter.m_Reporter ) )

3
pcbnew/exporters/board_exporter_base.h

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

7
pcbnew/files.cpp

@ -51,7 +51,6 @@
#include <widgets/wx_infobar.h>
#include <widgets/wx_progress_reporters.h>
#include <settings/settings_manager.h>
#include <string_utf8_map.h>
#include <paths.h>
#include <pgm_base.h>
#include <project/project_file.h>
@ -680,7 +679,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
THROW_IO_ERROR( _( "File format is not supported" ) );
}
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
if( m_importProperties )
props.insert( m_importProperties->begin(), m_importProperties->end() );
@ -1252,7 +1251,7 @@ bool PCB_EDIT_FRAME::doAutoSave()
bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
m_importProperties = aProperties;
@ -1305,7 +1304,7 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
wxString upperTxt;
wxString lowerTxt;
WX_PROGRESS_REPORTER reporter( this, _( "Generating IPC2581 file" ), 5 );
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
props["units"] = dlg.GetUnitsString();
props["sigfig"] = dlg.GetPrecision();

4
pcbnew/kicad_clipboard.cpp

@ -458,7 +458,7 @@ BOARD_ITEM* CLIPBOARD_IO::Parse()
void CLIPBOARD_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
init( aProperties );
@ -503,7 +503,7 @@ void CLIPBOARD_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
BOARD* CLIPBOARD_IO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
std::string result;

4
pcbnew/kicad_clipboard.h

@ -48,7 +48,7 @@ public:
* Saves the entire board to the clipboard formatted using the PCB_IO_KICAD_SEXPR formatting
*/
void SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
/*
* Write all the settings of the BOARD* set by setBoard() and then adds all the
@ -59,7 +59,7 @@ public:
BOARD_ITEM* Parse();
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
void SetBoard( BOARD* aBoard );

5
pcbnew/pcb_edit_frame.h

@ -56,7 +56,6 @@ class FP_LIB_TABLE;
class BOARD_NETLIST_UPDATER;
class ACTION_MENU;
class TOOL_ACTION;
class STRING_UTF8_MAP;
#ifdef KICAD_IPC_API
class KICAD_API_SERVER;
@ -814,7 +813,7 @@ protected:
* @param aFileType PCB_FILE_T value for file type
*/
bool importFile( const wxString& aFileName, int aFileType,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
void doCloseWindow() override;
@ -869,7 +868,7 @@ private:
DIALOG_BOOK_REPORTER* m_inspectConstraintsDlg;
DIALOG_BOOK_REPORTER* m_footprintDiffDlg;
const STRING_UTF8_MAP* m_importProperties; // Properties used for non-KiCad import.
const std::map<std::string, UTF8>* m_importProperties; // Properties used for non-KiCad import.
/**
* Keep track of viewport so that track net labels can be adjusted when it changes.

2
pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp

@ -64,7 +64,7 @@ bool PCB_IO_ALTIUM_CIRCUIT_MAKER::CanReadBoard( const wxString& aFileName ) cons
BOARD* PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties,
const std::map<std::string, UTF8>* aProperties,
PROJECT* aProject )
{
m_props = aProperties;

2
pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.h

@ -47,7 +47,7 @@ public:
bool CanReadBoard( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{

2
pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp

@ -65,7 +65,7 @@ bool PCB_IO_ALTIUM_CIRCUIT_STUDIO::CanReadBoard( const wxString& aFileName ) con
BOARD* PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties,
const std::map<std::string, UTF8>* aProperties,
PROJECT* aProject )
{
m_props = aProperties;

2
pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.h

@ -46,7 +46,7 @@ public:
bool CanReadBoard( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject ) override;
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{

6
pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp

@ -97,7 +97,7 @@ bool PCB_IO_ALTIUM_DESIGNER::CanReadLibrary( const wxString& aFileName ) const
BOARD* PCB_IO_ALTIUM_DESIGNER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
m_props = aProperties;
@ -217,7 +217,7 @@ void PCB_IO_ALTIUM_DESIGNER::loadAltiumLibrary( const wxString& aLibraryPath )
void PCB_IO_ALTIUM_DESIGNER::FootprintEnumerate( wxArrayString& aFootprintNames,
const wxString& aLibraryPath, bool aBestEfforts,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
loadAltiumLibrary( aLibraryPath );
@ -309,7 +309,7 @@ void PCB_IO_ALTIUM_DESIGNER::FootprintEnumerate( wxArrayString& aFootprintNames
FOOTPRINT* PCB_IO_ALTIUM_DESIGNER::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
loadAltiumLibrary( aLibraryPath );

6
pcbnew/pcb_io/altium/pcb_io_altium_designer.h

@ -53,16 +53,16 @@ public:
bool CanReadLibrary( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
//bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, const PROPERTIES* aProperties = nullptr );

2
pcbnew/pcb_io/altium/pcb_io_solidworks.cpp

@ -56,7 +56,7 @@ bool PCB_IO_SOLIDWORKS::CanReadBoard( const wxString& aFileName ) const
BOARD* PCB_IO_SOLIDWORKS::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
m_props = aProperties;

2
pcbnew/pcb_io/altium/pcb_io_solidworks.h

@ -41,7 +41,7 @@ public:
bool CanReadBoard( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{

18
pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp

@ -28,7 +28,6 @@
#include <pcb_io_cadstar_archive.h>
#include <board.h>
#include <footprint.h>
#include <string_utf8_map.h>
#include <io/io_utils.h>
#include <pcb_io/pcb_io.h>
#include <reporter.h>
@ -94,7 +93,7 @@ std::vector<FOOTPRINT*> PCB_IO_CADSTAR_ARCHIVE::GetImportedCachedLibraryFootprin
BOARD* PCB_IO_CADSTAR_ARCHIVE::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
m_props = aProperties;
m_board = aAppendToMe ? aAppendToMe : new BOARD();
@ -112,8 +111,13 @@ BOARD* PCB_IO_CADSTAR_ARCHIVE::LoadBoard( const wxString& aFileName, BOARD* aApp
UTF8 page_width;
UTF8 page_height;
if( aProperties->Value( "page_width", &page_width )
&& aProperties->Value( "page_height", &page_height ) )
if( auto it = aProperties->find( "page_width" ); it != aProperties->end() )
page_width = it->second;
if( auto it = aProperties->find( "page_height" ); it != aProperties->end() )
page_height = it->second;
if( !page_width.empty() && !page_height.empty() )
{
BOX2I bbbox = m_board->GetBoardEdgesBoundingBox();
@ -173,7 +177,7 @@ bool PCB_IO_CADSTAR_ARCHIVE::CanReadFootprint( const wxString& aFileName ) const
void PCB_IO_CADSTAR_ARCHIVE::FootprintEnumerate( wxArrayString& aFootprintNames,
const wxString& aLibraryPath,
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath );
@ -187,7 +191,7 @@ void PCB_IO_CADSTAR_ARCHIVE::FootprintEnumerate( wxArrayString& aFootpri
bool PCB_IO_CADSTAR_ARCHIVE::FootprintExists( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath );
@ -204,7 +208,7 @@ bool PCB_IO_CADSTAR_ARCHIVE::FootprintExists( const wxString& aLibraryPat
FOOTPRINT* PCB_IO_CADSTAR_ARCHIVE::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName,
bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
ensureLoadedLibrary( aLibraryPath );

8
pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.h

@ -44,7 +44,7 @@ public:
bool CanReadFootprint( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
@ -65,16 +65,16 @@ public:
void RegisterCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties = nullptr ) override;
// default implementation of GetEnumeratedFootprint is fine (call FootprintLoad)
bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;

18
pcbnew/pcb_io/eagle/pcb_io_eagle.cpp

@ -64,7 +64,6 @@ Load() TODO's
#include <font/fontconfig.h>
#include <string_utils.h>
#include <locale_io.h>
#include <string_utf8_map.h>
#include <trigo.h>
#include <progress_reporter.h>
#include <project.h>
@ -323,7 +322,7 @@ VECTOR2I inline PCB_IO_EAGLE::kicad_fontsize( const ECOORD& d, int aTextThicknes
BOARD* PCB_IO_EAGLE::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
wxXmlNode* doc;
@ -456,7 +455,7 @@ std::vector<FOOTPRINT*> PCB_IO_EAGLE::GetImportedCachedLibraryFootprints()
}
void PCB_IO_EAGLE::init( const STRING_UTF8_MAP* aProperties )
void PCB_IO_EAGLE::init( const std::map<std::string, UTF8>* aProperties )
{
m_hole_count = 0;
m_min_trace = 0;
@ -3136,8 +3135,13 @@ void PCB_IO_EAGLE::centerBoard()
UTF8 page_width;
UTF8 page_height;
if( m_props->Value( "page_width", &page_width ) &&
m_props->Value( "page_height", &page_height ) )
if( auto it = m_props->find( "page_width" ); it != m_props->end() )
page_width = it->second;
if( auto it = m_props->find( "page_height" ); it != m_props->end() )
page_height = it->second;
if( !page_width.empty() && !page_height.empty() )
{
BOX2I bbbox = m_board->GetBoardEdgesBoundingBox();
@ -3256,7 +3260,7 @@ void PCB_IO_EAGLE::cacheLib( const wxString& aLibPath )
void PCB_IO_EAGLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties )
{
wxString errorMsg;
@ -3284,7 +3288,7 @@ void PCB_IO_EAGLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxS
FOOTPRINT* PCB_IO_EAGLE::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
init( aProperties );
cacheLib( aLibraryPath );

8
pcbnew/pcb_io/eagle/pcb_io_eagle.h

@ -147,16 +147,16 @@ public:
bool CanReadFootprint( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr) override;
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties = nullptr) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{
@ -188,7 +188,7 @@ public:
private:
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void init( const STRING_UTF8_MAP* aProperties );
void init( const std::map<std::string, UTF8>* aProperties );
bool checkHeader( const wxString& aFileName ) const;

6
pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp

@ -135,7 +135,7 @@ bool PCB_IO_EASYEDA::CanReadLibrary( const wxString& aFileName ) const
BOARD* PCB_IO_EASYEDA::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
m_loadedFootprints.clear();
@ -285,7 +285,7 @@ long long PCB_IO_EASYEDA::GetLibraryTimestamp( const wxString& aLibraryPath ) co
void PCB_IO_EASYEDA::FootprintEnumerate( wxArrayString& aFootprintNames,
const wxString& aLibraryPath, bool aBestEfforts,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
try
{
@ -381,7 +381,7 @@ void PCB_IO_EASYEDA::FootprintEnumerate( wxArrayString& aFootprintNames,
FOOTPRINT* PCB_IO_EASYEDA::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
fontconfig::FONTCONFIG::SetReporter( nullptr );

6
pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.h

@ -48,19 +48,19 @@ public:
bool CanReadLibrary( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }

11
pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.cpp

@ -46,7 +46,6 @@
#include <json_common.h>
#include <core/json_serializers.h>
#include <core/map_helpers.h>
#include <string_utf8_map.h>
struct PCB_IO_EASYEDAPRO::PRJ_DATA
@ -100,7 +99,7 @@ bool PCB_IO_EASYEDAPRO::CanReadBoard( const wxString& aFileName ) const
BOARD* PCB_IO_EASYEDAPRO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
m_props = aProperties;
@ -130,9 +129,9 @@ BOARD* PCB_IO_EASYEDAPRO::LoadBoard( const wxString& aFileName, BOARD* aAppendTo
wxString pcbToLoad;
if( m_props && m_props->Exists( "pcb_id" ) )
if( m_props && m_props->contains( "pcb_id" ) )
{
pcbToLoad = wxString::FromUTF8( aProperties->at( "pcb_id" ) );
pcbToLoad = wxString::FromUTF8( m_props->at( "pcb_id" ) );
}
else
{
@ -198,7 +197,7 @@ long long PCB_IO_EASYEDAPRO::GetLibraryTimestamp( const wxString& aLibraryPath )
void PCB_IO_EASYEDAPRO::FootprintEnumerate( wxArrayString& aFootprintNames,
const wxString& aLibraryPath, bool aBestEfforts,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName fname( aLibraryPath );
@ -314,7 +313,7 @@ void PCB_IO_EASYEDAPRO::LoadAllDataFromProject( const wxString& aProjectPa
FOOTPRINT* PCB_IO_EASYEDAPRO::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
fontconfig::FONTCONFIG::SetReporter( nullptr );

6
pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.h

@ -55,19 +55,19 @@ public:
bool CanReadBoard( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }

2
pcbnew/pcb_io/fabmaster/pcb_io_fabmaster.cpp

@ -44,7 +44,7 @@ PCB_IO_FABMASTER::~PCB_IO_FABMASTER()
BOARD* PCB_IO_FABMASTER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
m_props = aProperties;

2
pcbnew/pcb_io/fabmaster/pcb_io_fabmaster.h

@ -45,7 +45,7 @@ public:
}
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{

14
pcbnew/pcb_io/geda/pcb_io_geda.cpp

@ -818,7 +818,7 @@ PCB_IO_GEDA::~PCB_IO_GEDA()
}
void PCB_IO_GEDA::init( const STRING_UTF8_MAP* aProperties )
void PCB_IO_GEDA::init( const std::map<std::string, UTF8>* aProperties )
{
m_props = aProperties;
}
@ -838,7 +838,7 @@ void PCB_IO_GEDA::validateCache( const wxString& aLibraryPath, bool checkModifie
FOOTPRINT* PCB_IO_GEDA::ImportFootprint( const wxString& aFootprintPath,
wxString& aFootprintNameOut,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName fn( aFootprintPath );
@ -861,7 +861,7 @@ FOOTPRINT* PCB_IO_GEDA::ImportFootprint( const wxString& aFootprintPath,
void PCB_IO_GEDA::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
wxDir dir( aLibraryPath );
@ -902,7 +902,7 @@ void PCB_IO_GEDA::FootprintEnumerate( wxArrayString& aFootprintNames, const wxSt
const FOOTPRINT* PCB_IO_GEDA::getFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties,
const std::map<std::string, UTF8>* aProperties,
bool checkModified )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -925,7 +925,7 @@ const FOOTPRINT* PCB_IO_GEDA::getFootprint( const wxString& aLibraryPath,
FOOTPRINT* PCB_IO_GEDA::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName,
bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
fontconfig::FONTCONFIG::SetReporter( nullptr );
@ -943,7 +943,7 @@ FOOTPRINT* PCB_IO_GEDA::FootprintLoad( const wxString& aLibraryPath,
void PCB_IO_GEDA::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -961,7 +961,7 @@ void PCB_IO_GEDA::FootprintDelete( const wxString& aLibraryPath, const wxString&
}
bool PCB_IO_GEDA::DeleteLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
bool PCB_IO_GEDA::DeleteLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties )
{
wxFileName fn;
fn.SetPath( aLibraryPath );

14
pcbnew/pcb_io/geda/pcb_io_geda.h

@ -59,21 +59,21 @@ public:
}
FOOTPRINT* ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut,
const STRING_UTF8_MAP* aProperties ) override;
const std::map<std::string, UTF8>* aProperties ) override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
@ -91,9 +91,9 @@ private:
void validateCache( const wxString& aLibraryPath, bool checkModified = true );
const FOOTPRINT* getFootprint( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties, bool checkModified );
const std::map<std::string, UTF8>* aProperties, bool checkModified );
void init( const STRING_UTF8_MAP* aProperties );
void init( const std::map<std::string, UTF8>* aProperties );
friend class GPCB_FPL_CACHE;

3
pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp

@ -36,7 +36,6 @@
#include <pgm_base.h>
#include <progress_reporter.h>
#include <settings/settings_manager.h>
#include <string_utf8_map.h>
#include <wx_fstream_progress.h>
#include <geometry/shape_line_chain.h>
@ -2919,7 +2918,7 @@ wxXmlNode* PCB_IO_IPC2581::generateAvlSection()
void PCB_IO_IPC2581::SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
m_board = aBoard;
m_units_str = "MILLIMETER";

6
pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.h

@ -71,11 +71,11 @@ public:
~PCB_IO_IPC2581() override;
// BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
// const STRING_UTF8_MAP* aProperties = nullptr,
// const std::map<std::string, UTF8>* aProperties = nullptr,
// PROJECT* aProject = nullptr ) override;
void SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override
{
@ -283,7 +283,7 @@ private:
BOARD* m_board;
std::vector<FOOTPRINT*> m_loaded_footprints;
const STRING_UTF8_MAP* m_props;
const std::map<std::string, UTF8>* m_props;
std::map<size_t, wxString> m_user_shape_dict; //<! Map between shape hash values and reference id string
wxXmlNode* m_shape_user_node; //<! Output XML node for reference shapes in UserDict

11
pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp

@ -73,7 +73,6 @@
#include <string_utils.h>
#include <locale_io.h>
#include <macros.h>
#include <string_utf8_map.h>
#include <filter_reader.h>
#include <zones.h>
@ -468,7 +467,7 @@ bool PCB_IO_KICAD_LEGACY::CanReadFootprint( const wxString& aFileName ) const
BOARD* PCB_IO_KICAD_LEGACY::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2911,7 +2910,7 @@ EDA_ANGLE PCB_IO_KICAD_LEGACY::degParse( const char* aValue, const char** nptrpt
}
void PCB_IO_KICAD_LEGACY::init( const STRING_UTF8_MAP* aProperties )
void PCB_IO_KICAD_LEGACY::init( const std::map<std::string, UTF8>* aProperties )
{
m_loading_format_version = 0;
m_cu_count = 16;
@ -3197,7 +3196,7 @@ void PCB_IO_KICAD_LEGACY::cacheLib( const wxString& aLibraryPath )
void PCB_IO_KICAD_LEGACY::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
wxString errorMsg;
@ -3226,7 +3225,7 @@ void PCB_IO_KICAD_LEGACY::FootprintEnumerate( wxArrayString& aFootprintNames, co
FOOTPRINT* PCB_IO_KICAD_LEGACY::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName, bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -3250,7 +3249,7 @@ FOOTPRINT* PCB_IO_KICAD_LEGACY::FootprintLoad( const wxString& aLibraryPath,
bool PCB_IO_KICAD_LEGACY::DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxFileName fn = aLibraryPath;

10
pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.h

@ -81,18 +81,18 @@ public:
bool CanReadFootprint( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
@ -109,7 +109,7 @@ public:
protected:
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void init( const STRING_UTF8_MAP* aProperties );
void init( const std::map<std::string, UTF8>* aProperties );
void checkpoint();

30
pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp

@ -307,7 +307,7 @@ bool PCB_IO_KICAD_SEXPR::CanReadBoard( const wxString& aFileName ) const
void PCB_IO_KICAD_SEXPR::SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2444,7 +2444,7 @@ void PCB_IO_KICAD_SEXPR::format( const ZONE* aZone, int aNestLevel ) const
m_out->Print( 0, " (hatch %s %s)\n", hatch.c_str(),
formatInternalUnits( aZone->GetBorderHatchPitch() ).c_str() );
if( aZone->GetAssignedPriority() > 0 )
m_out->Print( aNestLevel+1, "(priority %d)\n", aZone->GetAssignedPriority() );
@ -2650,7 +2650,7 @@ PCB_IO_KICAD_SEXPR::~PCB_IO_KICAD_SEXPR()
BOARD* PCB_IO_KICAD_SEXPR::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
FILE_LINE_READER reader( aFileName );
@ -2681,7 +2681,7 @@ BOARD* PCB_IO_KICAD_SEXPR::LoadBoard( const wxString& aFileName, BOARD* aAppendT
}
BOARD* PCB_IO_KICAD_SEXPR::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
BOARD* PCB_IO_KICAD_SEXPR::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const std::map<std::string, UTF8>* aProperties,
PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount)
{
init( aProperties );
@ -2717,7 +2717,7 @@ BOARD* PCB_IO_KICAD_SEXPR::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, con
}
void PCB_IO_KICAD_SEXPR::init( const STRING_UTF8_MAP* aProperties )
void PCB_IO_KICAD_SEXPR::init( const std::map<std::string, UTF8>* aProperties )
{
m_board = nullptr;
m_reader = nullptr;
@ -2740,7 +2740,7 @@ void PCB_IO_KICAD_SEXPR::validateCache( const wxString& aLibraryPath, bool check
void PCB_IO_KICAD_SEXPR::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
wxDir dir( aLibPath );
@ -2770,7 +2770,7 @@ void PCB_IO_KICAD_SEXPR::FootprintEnumerate( wxArrayString& aFootprintNames, con
const FOOTPRINT* PCB_IO_KICAD_SEXPR::getFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties,
const std::map<std::string, UTF8>* aProperties,
bool checkModified )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2798,14 +2798,14 @@ const FOOTPRINT* PCB_IO_KICAD_SEXPR::getFootprint( const wxString& aLibraryPath,
const FOOTPRINT* PCB_IO_KICAD_SEXPR::GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
return getFootprint( aLibraryPath, aFootprintName, aProperties, false );
}
bool PCB_IO_KICAD_SEXPR::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// Note: checking the cache sounds like a good idea, but won't catch files which differ
// only in case.
@ -2821,7 +2821,7 @@ bool PCB_IO_KICAD_SEXPR::FootprintExists( const wxString& aLibraryPath, const wx
FOOTPRINT* PCB_IO_KICAD_SEXPR::ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxString fcontents;
wxFFile f( aFootprintPath );
@ -2842,7 +2842,7 @@ FOOTPRINT* PCB_IO_KICAD_SEXPR::ImportFootprint( const wxString& aFootprintPath,
FOOTPRINT* PCB_IO_KICAD_SEXPR::FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName,
bool aKeepUUID,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
fontconfig::FONTCONFIG::SetReporter( nullptr );
@ -2866,7 +2866,7 @@ FOOTPRINT* PCB_IO_KICAD_SEXPR::FootprintLoad( const wxString& aLibraryPath,
void PCB_IO_KICAD_SEXPR::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2964,7 +2964,7 @@ void PCB_IO_KICAD_SEXPR::FootprintSave( const wxString& aLibraryPath, const FOOT
void PCB_IO_KICAD_SEXPR::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2989,7 +2989,7 @@ long long PCB_IO_KICAD_SEXPR::GetLibraryTimestamp( const wxString& aLibraryPath
}
void PCB_IO_KICAD_SEXPR::CreateLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
void PCB_IO_KICAD_SEXPR::CreateLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties )
{
if( wxDir::Exists( aLibraryPath ) )
{
@ -3007,7 +3007,7 @@ void PCB_IO_KICAD_SEXPR::CreateLibrary( const wxString& aLibraryPath, const STRI
}
bool PCB_IO_KICAD_SEXPR::DeleteLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
bool PCB_IO_KICAD_SEXPR::DeleteLibrary( const wxString& aLibraryPath, const std::map<std::string, UTF8>* aProperties )
{
wxFileName fn;
fn.SetPath( aLibraryPath );

28
pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h

@ -308,44 +308,44 @@ public:
bool CanReadBoard( const wxString& aFileName ) const override;
void SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
BOARD* DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties,
BOARD* DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const std::map<std::string, UTF8>* aProperties,
PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount );
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr ) override;
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties = nullptr ) override;
const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
FOOTPRINT* ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
void CreateLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr) override;
const std::map<std::string, UTF8>* aProperties = nullptr) override;
bool DeleteLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr ) override;
bool IsLibraryWritable( const wxString& aLibraryPath ) override;
@ -380,9 +380,9 @@ protected:
void validateCache( const wxString& aLibraryPath, bool checkModified = true );
const FOOTPRINT* getFootprint( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties, bool checkModified );
const std::map<std::string, UTF8>* aProperties, bool checkModified );
void init( const STRING_UTF8_MAP* aProperties );
void init( const std::map<std::string, UTF8>* aProperties );
/// formats the board setup information
void formatSetup( const BOARD* aBoard, int aNestLevel = 0 ) const;

2
pcbnew/pcb_io/pcad/pcb_io_pcad.cpp

@ -63,7 +63,7 @@ bool PCB_IO_PCAD::CanReadBoard( const wxString& aFileName ) const
BOARD* PCB_IO_PCAD::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
wxXmlDocument xmlDoc;

2
pcbnew/pcb_io/pcad/pcb_io_pcad.h

@ -53,7 +53,7 @@ public:
bool CanReadBoard( const wxString& aFileName ) const override;
BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
{

23
pcbnew/pcb_io/pcb_io.cpp

@ -26,7 +26,6 @@
#include <pcb_io/pcb_io.h>
#include <pcb_io/pcb_io_mgr.h>
#include <ki_exception.h>
#include <string_utf8_map.h>
#include <wx/log.h>
#include <wx/filename.h>
#include <wx/translation.h>
@ -73,7 +72,7 @@ bool PCB_IO::CanReadFootprint( const wxString& aFileName ) const
BOARD* PCB_IO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject )
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
{
NOT_IMPLEMENTED( __FUNCTION__ );
}
@ -86,7 +85,7 @@ std::vector<FOOTPRINT*> PCB_IO::GetImportedCachedLibraryFootprints()
void PCB_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -94,20 +93,20 @@ void PCB_IO::SaveBoard( const wxString& aFileName, BOARD* aBoard,
void PCB_IO::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties )
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
NOT_IMPLEMENTED( __FUNCTION__ );
}
void PCB_IO::PrefetchLib( const wxString&, const STRING_UTF8_MAP* )
void PCB_IO::PrefetchLib( const wxString&, const std::map<std::string, UTF8>* )
{
}
FOOTPRINT* PCB_IO::ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
wxArrayString footprintNames;
@ -132,7 +131,7 @@ FOOTPRINT* PCB_IO::ImportFootprint( const wxString& aFootprintPath, wxString& aF
const FOOTPRINT* PCB_IO::GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// default implementation
return FootprintLoad( aLibraryPath, aFootprintName, false, aProperties );
@ -140,7 +139,7 @@ const FOOTPRINT* PCB_IO::GetEnumeratedFootprint( const wxString& aLibraryPath,
bool PCB_IO::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// default implementation
return FootprintLoad( aLibraryPath, aFootprintName, true, aProperties ) != nullptr;
@ -148,7 +147,7 @@ bool PCB_IO::FootprintExists( const wxString& aLibraryPath, const wxString& aFoo
FOOTPRINT* PCB_IO::FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
bool aKeepUUID, const STRING_UTF8_MAP* aProperties )
bool aKeepUUID, const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -156,7 +155,7 @@ FOOTPRINT* PCB_IO::FootprintLoad( const wxString& aLibraryPath, const wxString&
void PCB_IO::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
NOT_IMPLEMENTED( __FUNCTION__ );
@ -164,14 +163,14 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFoot
void PCB_IO::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
NOT_IMPLEMENTED( __FUNCTION__ );
}
void PCB_IO::GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const
void PCB_IO::GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const
{
// Get base options first
IO_BASE::GetLibraryOptions( aListToAppendTo );

25
pcbnew/pcb_io/pcb_io.h

@ -36,7 +36,6 @@
class BOARD;
class FOOTPRINT;
class STRING_UTF8_MAP;
class PROJECT;
class PROGRESS_REPORTER;
@ -127,7 +126,7 @@ public:
* possible.
*/
virtual BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr );
/**
* Return a container with the cached library footprints generated in the last call to
@ -158,7 +157,7 @@ public:
* @throw IO_ERROR if there is a problem saving or exporting.
*/
virtual void SaveBoard( const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Return a list of footprint names contained within the library at @a aLibraryPath.
@ -175,7 +174,7 @@ public:
* @throw IO_ERROR if the library cannot be found, or footprint cannot be loaded.
*/
virtual void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr );
bool aBestEfforts, const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Generate a timestamp representing all the files in the library (including the library
@ -203,7 +202,7 @@ public:
* @throw IO_ERROR if there is an error prefetching the library.
*/
virtual void PrefetchLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Load a single footprint from @a aFootprintPath and put its name in @a aFootprintNameOut.
@ -223,7 +222,7 @@ public:
* @throw IO_ERROR if the footprint cannot be found or read.
*/
virtual FOOTPRINT* ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Load a footprint having @a aFootprintName from the @a aLibraryPath containing a library
@ -249,7 +248,7 @@ public:
virtual FOOTPRINT* FootprintLoad( const wxString& aLibraryPath,
const wxString& aFootprintName,
bool aKeepUUID = false,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* A version of FootprintLoad() for use after FootprintEnumerate() for more efficient
@ -257,13 +256,13 @@ public:
*/
virtual const FOOTPRINT* GetEnumeratedFootprint( const wxString& aLibraryPath,
const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Check for the existence of a footprint.
*/
virtual bool FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Write @a aFootprint to an existing library located at @a aLibraryPath.
@ -282,7 +281,7 @@ public:
* @throw IO_ERROR if there is a problem saving.
*/
virtual void FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Delete @a aFootprintName from the library at @a aLibraryPath.
@ -299,7 +298,7 @@ public:
* @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,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Append supported PLUGIN options to @a aListToAppenTo along with internationalized
@ -328,7 +327,7 @@ public:
* This would require a 3 column list, and introducing wx GUI knowledge to
* PLUGIN, which has been avoided to date.
*/
virtual void GetLibraryOptions( STRING_UTF8_MAP* aListToAppendTo ) const override;
virtual void GetLibraryOptions( std::map<std::string, UTF8>* aListToAppendTo ) const override;
virtual ~PCB_IO()
{};
@ -343,7 +342,7 @@ protected:
BOARD* m_board;
/// Properties passed via Save() or Load(), no ownership, may be NULL.
const STRING_UTF8_MAP* m_props;
const std::map<std::string, UTF8>* m_props;
};
#endif // PCB_IO_H_

6
pcbnew/pcb_io/pcb_io_mgr.cpp

@ -155,7 +155,7 @@ PCB_IO_MGR::PCB_FILE_T PCB_IO_MGR::GuessPluginTypeFromLibPath( const wxString& a
BOARD* PCB_IO_MGR::Load( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aAppendToMe,
const STRING_UTF8_MAP* aProperties, PROJECT* aProject,
const std::map<std::string, UTF8>* aProperties, PROJECT* aProject,
PROGRESS_REPORTER* aProgressReporter )
{
IO_RELEASER<PCB_IO> pi( PluginFind( aFileType ) );
@ -171,7 +171,7 @@ BOARD* PCB_IO_MGR::Load( PCB_FILE_T aFileType, const wxString& aFileName, BOARD*
void PCB_IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties )
const std::map<std::string, UTF8>* aProperties )
{
IO_RELEASER<PCB_IO> pi( PluginFind( aFileType ) );
@ -185,7 +185,7 @@ void PCB_IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* a
}
bool PCB_IO_MGR::ConvertLibrary( STRING_UTF8_MAP* aOldFileProps, const wxString& aOldFilePath,
bool PCB_IO_MGR::ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, const wxString& aOldFilePath,
const wxString& aNewFilePath, REPORTER* aReporter )
{
PCB_IO_MGR::PCB_FILE_T oldFileType = PCB_IO_MGR::GuessPluginTypeFromLibPath( aOldFilePath );

7
pcbnew/pcb_io/pcb_io_mgr.h

@ -37,7 +37,6 @@
class BOARD;
class PCB_IO;
class FOOTPRINT;
class STRING_UTF8_MAP;
class PROJECT;
class PROGRESS_REPORTER;
class REPORTER;
@ -204,7 +203,7 @@ public:
* be loaded.
*/
static BOARD* Load( PCB_FILE_T aFileType, const wxString& aFileName,
BOARD* aAppendToMe = nullptr, const STRING_UTF8_MAP* aProperties = nullptr,
BOARD* aAppendToMe = nullptr, const std::map<std::string, UTF8>* aProperties = nullptr,
PROJECT* aProject = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr );
@ -228,12 +227,12 @@ public:
* @throw IO_ERROR if there is a problem saving or exporting.
*/
static void Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoard,
const STRING_UTF8_MAP* aProperties = nullptr );
const std::map<std::string, UTF8>* aProperties = nullptr );
/**
* Convert a schematic symbol library to the latest KiCad format
*/
static bool ConvertLibrary( STRING_UTF8_MAP* aOldFileProps, const wxString& aOldFilePath,
static bool ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, const wxString& aOldFilePath,
const wxString& aNewFilePath, REPORTER* aReporter );
};

3
pcbnew/pcbnew_jobs_handler.cpp

@ -70,7 +70,6 @@
#include <project_pcb.h>
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
#include <reporter.h>
#include <string_utf8_map.h>
#include <wildcards_and_files_ext.h>
#include <export_vrml.h>
#include <wx/wfstream.h>
@ -1453,7 +1452,7 @@ int PCBNEW_JOBS_HANDLER::JobExportIpc2581( JOB* aJob )
job->m_outputFile = fn.GetFullName();
}
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
props["units"] = job->m_units == JOB_EXPORT_PCB_IPC2581::IPC2581_UNITS::MILLIMETERS ? "mm"
: "inch";
props["sigfig"] = wxString::Format( "%d", job->m_precision );

3
pcbnew/tools/pcb_control.cpp

@ -59,7 +59,6 @@
#include <origin_viewitem.h>
#include <pcb_edit_frame.h>
#include <pcb_painter.h>
#include <string_utf8_map.h>
#include <settings/color_settings.h>
#include <string>
#include <tool/tool_manager.h>
@ -1371,7 +1370,7 @@ int PCB_CONTROL::AppendBoard( PCB_IO& pi, wxString& fileName )
// Load the data
try
{
STRING_UTF8_MAP props;
std::map<std::string, UTF8> props;
// PCB_IO_EAGLE can use this info to center the BOARD, but it does not yet.

4
thirdparty/pybind11/tools/pybind11Config.cmake.in

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

Loading…
Cancel
Save