mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 00:21:31 +00:00
Rename PROPERTIES to STRING_UTF8_MAP for clarity
This class has nothing to do with the properties system
This commit is contained in:
parent
68de92313e
commit
dd94b2d3a7
common
eeschema
project_rescue.cppproject_rescue.hsch_io_mgr.hsch_plugin.cppsymbol_library.cppsymbol_library.hsymbol_library_manager.cpp
sch_plugins
altium
cadstar
database
eagle
kicad
legacy
include
pcbnew
dialogs
exporters
files.cppio_mgr.cppio_mgr.hkicad_clipboard.cppkicad_clipboard.hplugin.cppplugins
altium
altium_circuit_maker_plugin.cppaltium_circuit_maker_plugin.haltium_circuit_studio_plugin.cppaltium_circuit_studio_plugin.haltium_designer_plugin.cppaltium_designer_plugin.h
cadstar
eagle
fabmaster
geda
kicad
legacy
pcad
tools
thirdparty/pybind11/tools
@ -361,7 +361,6 @@ set( COMMON_SRCS
|
||||
paths.cpp
|
||||
printout.cpp
|
||||
project.cpp
|
||||
properties.cpp
|
||||
ptree.cpp
|
||||
rc_item.cpp
|
||||
refdes_utils.cpp
|
||||
@ -372,6 +371,7 @@ set( COMMON_SRCS
|
||||
search_stack.cpp
|
||||
searchhelpfilefullpath.cpp
|
||||
status_popup.cpp
|
||||
string_utf8_map.cpp
|
||||
stroke_params.cpp
|
||||
systemdirsappend.cpp
|
||||
template_fieldnames.cpp
|
||||
|
@ -45,7 +45,7 @@ LIB_TABLE_ROW* new_clone( const LIB_TABLE_ROW& aRow )
|
||||
}
|
||||
|
||||
|
||||
void LIB_TABLE_ROW::setProperties( PROPERTIES* aProperties )
|
||||
void LIB_TABLE_ROW::setProperties( STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
properties.reset( aProperties );
|
||||
}
|
||||
@ -355,14 +355,14 @@ void LIB_TABLE::Save( const wxString& aFileName ) const
|
||||
}
|
||||
|
||||
|
||||
PROPERTIES* LIB_TABLE::ParseOptions( const std::string& aOptionsList )
|
||||
STRING_UTF8_MAP* LIB_TABLE::ParseOptions( const std::string& aOptionsList )
|
||||
{
|
||||
if( aOptionsList.size() )
|
||||
{
|
||||
const char* cp = &aOptionsList[0];
|
||||
const char* end = cp + aOptionsList.size();
|
||||
|
||||
PROPERTIES props;
|
||||
STRING_UTF8_MAP props;
|
||||
std::string pair;
|
||||
|
||||
// Parse all name=value pairs
|
||||
@ -413,20 +413,20 @@ PROPERTIES* LIB_TABLE::ParseOptions( const std::string& aOptionsList )
|
||||
}
|
||||
|
||||
if( props.size() )
|
||||
return new PROPERTIES( props );
|
||||
return new STRING_UTF8_MAP( props );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
UTF8 LIB_TABLE::FormatOptions( const PROPERTIES* aProperties )
|
||||
UTF8 LIB_TABLE::FormatOptions( const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
UTF8 ret;
|
||||
|
||||
if( aProperties )
|
||||
{
|
||||
for( PROPERTIES::const_iterator it = aProperties->begin(); it != aProperties->end(); ++it )
|
||||
for( STRING_UTF8_MAP::const_iterator it = aProperties->begin(); it != aProperties->end(); ++it )
|
||||
{
|
||||
const std::string& name = it->first;
|
||||
|
||||
|
@ -18,12 +18,12 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
|
||||
|
||||
bool PROPERTIES::Value( const char* aName, UTF8* aFetchedValue ) const
|
||||
bool STRING_UTF8_MAP::Value( const char* aName, UTF8* aFetchedValue ) const
|
||||
{
|
||||
PROPERTIES::const_iterator it = find( aName );
|
||||
STRING_UTF8_MAP::const_iterator it = find( aName );
|
||||
|
||||
if( it != end() )
|
||||
{
|
@ -793,7 +793,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<PROPERTIES>();
|
||||
m_properties = std::make_unique<STRING_UTF8_MAP>();
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <wx/string.h>
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
#include <lib_symbol.h>
|
||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
||||
#include <class_draw_panel_gal.h>
|
||||
@ -381,7 +381,7 @@ public:
|
||||
private:
|
||||
std::vector<std::unique_ptr<LIB_SYMBOL>> m_rescueLibSymbols;
|
||||
|
||||
std::unique_ptr< PROPERTIES > m_properties; ///< Library plugin properties.
|
||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
|
||||
};
|
||||
|
||||
#endif // _LIB_CACHE_RESCUE_H_
|
||||
|
@ -38,7 +38,7 @@ class SYMBOL_LIB_TABLE;
|
||||
class KIWAY;
|
||||
class LIB_SYMBOL;
|
||||
class SYMBOL_LIB;
|
||||
class PROPERTIES;
|
||||
class STRING_UTF8_MAP;
|
||||
class PROGRESS_REPORTER;
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ public:
|
||||
*/
|
||||
virtual int GetModifyHash() const = 0;
|
||||
|
||||
virtual void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = nullptr );
|
||||
virtual void SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Load information from some input file format that this #SCH_PLUGIN implementation
|
||||
@ -225,7 +225,7 @@ public:
|
||||
*/
|
||||
virtual SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe = nullptr,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Write \a aSchematic to a storage file in a format that this #SCH_PLUGIN implementation
|
||||
@ -253,7 +253,7 @@ public:
|
||||
* @throw IO_ERROR if there is a problem saving or exporting.
|
||||
*/
|
||||
virtual void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Populate a list of #LIB_SYMBOL alias names contained within the library \a aLibraryPath.
|
||||
@ -272,7 +272,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 PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Populate a list of #LIB_SYMBOL aliases contained within the library \a aLibraryPath.
|
||||
@ -295,7 +295,7 @@ public:
|
||||
*/
|
||||
virtual void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Load a #LIB_SYMBOL object having \a aPartName from the \a aLibraryPath containing
|
||||
@ -319,7 +319,7 @@ public:
|
||||
* is thrown in the case where aAliasName cannot be found.
|
||||
*/
|
||||
virtual LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aPartName,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Write \a aSymbol to an existing library located at \a aLibraryPath. If a #LIB_SYMBOL
|
||||
@ -343,7 +343,7 @@ public:
|
||||
* @throw IO_ERROR if there is a problem saving.
|
||||
*/
|
||||
virtual void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Delete the entire #LIB_SYMBOL associated with \a aAliasName from the library
|
||||
@ -364,7 +364,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 PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Create a new empty symbol library at \a aLibraryPath. It is an error to attempt
|
||||
@ -382,7 +382,7 @@ public:
|
||||
* @throw IO_ERROR if there is a problem finding the library, or creating it.
|
||||
*/
|
||||
virtual void CreateSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Delete an existing symbol library and returns true if successful, or if library
|
||||
@ -404,7 +404,7 @@ public:
|
||||
* @throw IO_ERROR if there is a problem deleting an existing library.
|
||||
*/
|
||||
virtual bool DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr );
|
||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
|
||||
/**
|
||||
* Return true if the library at \a aLibraryPath is writable. (Often
|
||||
@ -441,7 +441,7 @@ public:
|
||||
* This would require a 3 column list, and introducing wx GUI knowledge to
|
||||
* #SCH_PLUGIN, which has been avoided to date.
|
||||
*/
|
||||
virtual void SymbolLibOptions( PROPERTIES* aListToAppendTo ) const;
|
||||
virtual void SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const;
|
||||
|
||||
/**
|
||||
* @return true if this plugin supports libraries that contain sub-libraries.
|
||||
|
@ -20,7 +20,7 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
|
||||
#include <sch_io_mgr.h>
|
||||
#include <wx/translation.h>
|
||||
@ -42,14 +42,14 @@ static void not_implemented( const SCH_PLUGIN* aPlugin, const char* aCaller )
|
||||
}
|
||||
|
||||
|
||||
void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties )
|
||||
void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
}
|
||||
|
||||
|
||||
SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties )
|
||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
return nullptr;
|
||||
@ -57,7 +57,7 @@ SCH_SHEET* SCH_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
|
||||
|
||||
void SCH_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
@ -66,7 +66,7 @@ void SCH_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC*
|
||||
|
||||
void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
@ -75,7 +75,7 @@ void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList,
|
||||
|
||||
void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
@ -83,7 +83,7 @@ void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
|
||||
|
||||
LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
@ -92,7 +92,7 @@ LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString
|
||||
|
||||
|
||||
void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
@ -100,21 +100,21 @@ void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSy
|
||||
|
||||
|
||||
void SCH_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
}
|
||||
|
||||
|
||||
void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const PROPERTIES* aProperties )
|
||||
void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
}
|
||||
|
||||
|
||||
bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const PROPERTIES* aProperties )
|
||||
bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
||||
not_implemented( this, __FUNCTION__ );
|
||||
@ -130,7 +130,7 @@ bool SCH_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
|
||||
}
|
||||
|
||||
|
||||
void SCH_PLUGIN::SymbolLibOptions( PROPERTIES* aListToAppendTo ) const
|
||||
void SCH_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
|
||||
{
|
||||
// disable all these in another couple of months, after everyone has seen them:
|
||||
#if 1
|
||||
|
@ -220,7 +220,7 @@ wxFileName SCH_ALTIUM_PLUGIN::getLibFileName()
|
||||
|
||||
|
||||
SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties )
|
||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr );
|
||||
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
|
||||
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe = nullptr,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
bool CheckHeader( const wxString& aFileName ) override;
|
||||
|
||||
@ -160,7 +160,7 @@ private:
|
||||
wxString m_libName; // Library name to save symbols
|
||||
|
||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; // Plugin to create KiCad symbol library.
|
||||
std::unique_ptr<PROPERTIES> m_properties; // Library plugin properties.
|
||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; // Library plugin properties.
|
||||
|
||||
std::unique_ptr<TITLE_BLOCK> m_currentTitleBlock; // Will be assigned at the end of parsing
|
||||
// a sheet
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <sch_plugins/cadstar/cadstar_sch_archive_loader.h>
|
||||
#include <sch_plugins/cadstar/cadstar_sch_archive_plugin.h>
|
||||
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
#include <sch_screen.h>
|
||||
#include <sch_sheet.h>
|
||||
#include <schematic.h>
|
||||
@ -59,7 +59,7 @@ int CADSTAR_SCH_ARCHIVE_PLUGIN::GetModifyHash() const
|
||||
|
||||
|
||||
SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties )
|
||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxASSERT( !aFileName || aSchematic != NULL );
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
|
||||
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe = nullptr,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
bool CheckHeader( const wxString& aFileName ) override;
|
||||
|
||||
|
@ -46,7 +46,7 @@ SCH_DATABASE_PLUGIN::~SCH_DATABASE_PLUGIN()
|
||||
|
||||
void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
std::vector<LIB_SYMBOL*> symbols;
|
||||
EnumerateSymbolLib( symbols, aLibraryPath, aProperties );
|
||||
@ -58,7 +58,7 @@ void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
|
||||
void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxCHECK_RET( m_libTable, "Database plugin missing library table handle!" );
|
||||
ensureSettings( aLibraryPath );
|
||||
@ -103,7 +103,7 @@ void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolL
|
||||
|
||||
LIB_SYMBOL* SCH_DATABASE_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
|
||||
const wxString& aAliasName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxCHECK( m_libTable, nullptr );
|
||||
ensureSettings( aLibraryPath );
|
||||
|
@ -64,14 +64,14 @@ public:
|
||||
|
||||
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
bool SupportsSubLibraries() const override { return true; }
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <sch_plugins/eagle/sch_eagle_plugin.h>
|
||||
|
||||
#include <locale_io.h>
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
@ -427,7 +427,7 @@ void SCH_EAGLE_PLUGIN::checkpoint()
|
||||
|
||||
|
||||
SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties )
|
||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxASSERT( !aFileName || aSchematic != nullptr );
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
@ -485,7 +485,7 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
|
||||
wxCHECK_MSG( libTable, nullptr, wxT( "Could not load symbol lib table." ) );
|
||||
|
||||
m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
||||
m_properties = std::make_unique<PROPERTIES>();
|
||||
m_properties = std::make_unique<STRING_UTF8_MAP>();
|
||||
( *m_properties )[SCH_LEGACY_PLUGIN::PropBuffering] = "";
|
||||
|
||||
/// @note No check is being done here to see if the existing symbol library exists so this
|
||||
|
@ -47,7 +47,7 @@ class SCH_TEXT;
|
||||
class SCH_GLOBALLABEL;
|
||||
class SCH_SYMBOL;
|
||||
class SCH_FIELD;
|
||||
class PROPERTIES;
|
||||
class STRING_UTF8_MAP;
|
||||
class SCH_EAGLE_PLUGIN_CACHE;
|
||||
class LIB_SYMBOL;
|
||||
class SYMBOL_LIB;
|
||||
@ -100,7 +100,7 @@ public:
|
||||
|
||||
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe = nullptr,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
bool CheckHeader( const wxString& aFileName ) override;
|
||||
|
||||
@ -228,7 +228,7 @@ private:
|
||||
std::map<wxString, EAGLE_LIBRARY> m_eagleLibs;
|
||||
|
||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; ///< PI to create KiCad symbol library.
|
||||
std::unique_ptr< PROPERTIES > m_properties; ///< Library plugin properties.
|
||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
|
||||
|
||||
PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr
|
||||
unsigned m_doneCount;
|
||||
|
@ -85,7 +85,7 @@ SCH_SEXPR_PLUGIN::~SCH_SEXPR_PLUGIN()
|
||||
}
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties )
|
||||
void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
m_version = 0;
|
||||
m_appending = false;
|
||||
@ -98,7 +98,7 @@ void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const PROPERTIES* aPropertie
|
||||
|
||||
|
||||
SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties )
|
||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxASSERT( !aFileName || aSchematic != nullptr );
|
||||
|
||||
@ -319,7 +319,7 @@ void SCH_SEXPR_PLUGIN::LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet, int
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
|
||||
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
|
||||
@ -1297,7 +1297,7 @@ void SCH_SEXPR_PLUGIN::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aSh
|
||||
}
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties )
|
||||
void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
|
||||
{
|
||||
@ -1311,7 +1311,7 @@ void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPERT
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SEXPR_PLUGIN::isBuffering( const PROPERTIES* aProperties )
|
||||
bool SCH_SEXPR_PLUGIN::isBuffering( const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
return ( aProperties && aProperties->Exists( SCH_SEXPR_PLUGIN::PropBuffering ) );
|
||||
}
|
||||
@ -1329,7 +1329,7 @@ int SCH_SEXPR_PLUGIN::GetModifyHash() const
|
||||
|
||||
void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -1350,7 +1350,7 @@ void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
|
||||
void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -1370,7 +1370,7 @@ void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList
|
||||
|
||||
|
||||
LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -1386,7 +1386,7 @@ LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wx
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -1400,7 +1400,7 @@ void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBO
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -1414,7 +1414,7 @@ void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxStrin
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
if( wxFileExists( aLibraryPath ) )
|
||||
{
|
||||
@ -1433,7 +1433,7 @@ void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
|
||||
|
||||
|
||||
bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxFileName fn = aLibraryPath;
|
||||
|
||||
@ -1458,7 +1458,7 @@ bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
}
|
||||
|
||||
|
||||
void SCH_SEXPR_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const PROPERTIES* aProperties )
|
||||
void SCH_SEXPR_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
if( !m_cache )
|
||||
m_cache = new SCH_SEXPR_PLUGIN_CACHE( aLibraryPath );
|
||||
|
@ -46,7 +46,7 @@ class SCH_TEXTBOX;
|
||||
class SCH_SYMBOL;
|
||||
class SCH_FIELD;
|
||||
struct SYMBOL_INSTANCE_REFERENCE;
|
||||
class PROPERTIES;
|
||||
class STRING_UTF8_MAP;
|
||||
class EE_SELECTION;
|
||||
class SCH_SEXPR_PLUGIN_CACHE;
|
||||
class LIB_SYMBOL;
|
||||
@ -97,13 +97,13 @@ public:
|
||||
|
||||
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe = nullptr,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
void LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet,
|
||||
int aVersion = SEXPR_SCHEMATIC_FILE_VERSION );
|
||||
|
||||
void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
void Format( SCH_SHEET* aSheet );
|
||||
|
||||
@ -112,22 +112,22 @@ public:
|
||||
|
||||
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void CreateSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
bool DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void SaveLibrary( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
bool CheckHeader( const wxString& aFileName ) override;
|
||||
bool IsSymbolLibWritable( const wxString& aLibraryPath ) override;
|
||||
@ -160,8 +160,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 PROPERTIES* aProperties );
|
||||
bool isBuffering( const PROPERTIES* aProperties );
|
||||
void cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties );
|
||||
bool isBuffering( const STRING_UTF8_MAP* aProperties );
|
||||
|
||||
protected:
|
||||
int m_version; ///< Version of file being loaded.
|
||||
@ -179,7 +179,7 @@ protected:
|
||||
SCH_SEXPR_PLUGIN_CACHE* m_cache;
|
||||
|
||||
/// initialize PLUGIN like a constructor would.
|
||||
void init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties = nullptr );
|
||||
void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
};
|
||||
|
||||
#endif // _SCH_SEXPR_PLUGIN_H_
|
||||
|
@ -88,7 +88,7 @@ SCH_LEGACY_PLUGIN::~SCH_LEGACY_PLUGIN()
|
||||
}
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties )
|
||||
void SCH_LEGACY_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
m_version = 0;
|
||||
m_rootSheet = nullptr;
|
||||
@ -122,7 +122,7 @@ void SCH_LEGACY_PLUGIN::checkpoint()
|
||||
|
||||
|
||||
SCH_SHEET* SCH_LEGACY_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe, const PROPERTIES* aProperties )
|
||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxASSERT( !aFileName || aSchematic != nullptr );
|
||||
|
||||
@ -1447,7 +1447,7 @@ std::shared_ptr<BUS_ALIAS> SCH_LEGACY_PLUGIN::loadBusAlias( LINE_READER& aReader
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
|
||||
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
|
||||
@ -2035,7 +2035,7 @@ void SCH_LEGACY_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
|
||||
}
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties )
|
||||
void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
|
||||
{
|
||||
@ -2049,7 +2049,7 @@ void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const PROPER
|
||||
}
|
||||
|
||||
|
||||
bool SCH_LEGACY_PLUGIN::writeDocFile( const PROPERTIES* aProperties )
|
||||
bool SCH_LEGACY_PLUGIN::writeDocFile( const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
std::string propName( SCH_LEGACY_PLUGIN::PropNoDocFile );
|
||||
|
||||
@ -2060,7 +2060,7 @@ bool SCH_LEGACY_PLUGIN::writeDocFile( const PROPERTIES* aProperties )
|
||||
}
|
||||
|
||||
|
||||
bool SCH_LEGACY_PLUGIN::isBuffering( const PROPERTIES* aProperties )
|
||||
bool SCH_LEGACY_PLUGIN::isBuffering( const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
return ( aProperties && aProperties->Exists( SCH_LEGACY_PLUGIN::PropBuffering ) );
|
||||
}
|
||||
@ -2078,7 +2078,7 @@ int SCH_LEGACY_PLUGIN::GetModifyHash() const
|
||||
|
||||
void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -2099,7 +2099,7 @@ void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
|
||||
void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -2120,7 +2120,7 @@ void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLis
|
||||
|
||||
LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
|
||||
const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -2136,7 +2136,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -2150,7 +2150,7 @@ void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMB
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
||||
|
||||
@ -2164,7 +2164,7 @@ void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxStri
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
if( wxFileExists( aLibraryPath ) )
|
||||
{
|
||||
@ -2183,7 +2183,7 @@ void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
|
||||
|
||||
|
||||
bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties )
|
||||
const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
wxFileName fn = aLibraryPath;
|
||||
|
||||
@ -2208,7 +2208,7 @@ bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
}
|
||||
|
||||
|
||||
void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const PROPERTIES* aProperties )
|
||||
void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||
{
|
||||
if( !m_cache )
|
||||
m_cache = new SCH_LEGACY_PLUGIN_CACHE( aLibraryPath );
|
||||
|
@ -41,7 +41,7 @@ class SCH_BUS_ENTRY_BASE;
|
||||
class SCH_TEXT;
|
||||
class SCH_SYMBOL;
|
||||
class SCH_FIELD;
|
||||
class PROPERTIES;
|
||||
class STRING_UTF8_MAP;
|
||||
class SELECTION;
|
||||
class SCH_LEGACY_PLUGIN_CACHE;
|
||||
class LIB_SYMBOL;
|
||||
@ -104,13 +104,13 @@ public:
|
||||
|
||||
SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||
SCH_SHEET* aAppendToMe = nullptr,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
void LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen,
|
||||
int version = EESCHEMA_VERSION );
|
||||
|
||||
void Save( const wxString& aFileName, SCH_SHEET* aScreen, SCHEMATIC* aSchematic,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
void Format( SCH_SHEET* aSheet );
|
||||
|
||||
@ -118,22 +118,22 @@ public:
|
||||
|
||||
void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||
const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
LIB_SYMBOL* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void CreateSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
bool DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
void SaveLibrary( const wxString& aLibraryPath,
|
||||
const PROPERTIES* aProperties = nullptr ) override;
|
||||
const STRING_UTF8_MAP* aProperties = nullptr ) override;
|
||||
|
||||
bool CheckHeader( const wxString& aFileName ) override;
|
||||
bool IsSymbolLibWritable( const wxString& aLibraryPath ) override;
|
||||
@ -171,9 +171,9 @@ private:
|
||||
void saveText( SCH_TEXT* aText );
|
||||
void saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias );
|
||||
|
||||
void cacheLib( const wxString& aLibraryFileName, const PROPERTIES* aProperties );
|
||||
bool writeDocFile( const PROPERTIES* aProperties );
|
||||
bool isBuffering( const PROPERTIES* aProperties );
|
||||
void cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties );
|
||||
bool writeDocFile( const STRING_UTF8_MAP* aProperties );
|
||||
bool isBuffering( const STRING_UTF8_MAP* aProperties );
|
||||
|
||||
protected:
|
||||
int m_version; ///< Version of file being loaded.
|
||||
@ -197,7 +197,7 @@ protected:
|
||||
SCHEMATIC* m_schematic;
|
||||
|
||||
/// initialize PLUGIN like a constructor would.
|
||||
void init( SCHEMATIC* aSchematic, const PROPERTIES* aProperties = nullptr );
|
||||
void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
|
||||
};
|
||||
|
||||
#endif // _SCH_LEGACY_PLUGIN_H_
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <project/project_file.h>
|
||||
#include <project_rescue.h>
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
#include <widgets/app_progress_dialog.h>
|
||||
|
||||
#include <general.h>
|
||||
@ -61,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<PROPERTIES>();
|
||||
m_properties = std::make_unique<STRING_UTF8_MAP>();
|
||||
m_mod_hash = 0;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ void SYMBOL_LIB::Save( bool aSaveDocFile )
|
||||
wxString::Format( wxT( "no plugin defined for library `%s`." ),
|
||||
fileName.GetFullPath() ) );
|
||||
|
||||
PROPERTIES props;
|
||||
STRING_UTF8_MAP props;
|
||||
|
||||
if( !aSaveDocFile )
|
||||
props[ SCH_LEGACY_PLUGIN::PropNoDocFile ] = "";
|
||||
|
@ -44,7 +44,7 @@ class LIB_SYMBOL;
|
||||
class LIB_ID;
|
||||
class LINE_READER;
|
||||
class OUTPUTFORMATTER;
|
||||
class PROPERTIES;
|
||||
class STRING_UTF8_MAP;
|
||||
class SCH_PLUGIN;
|
||||
class SYMBOL_LIB;
|
||||
|
||||
@ -316,7 +316,7 @@ private:
|
||||
|
||||
SCH_IO_MGR::SCH_FILE_T m_pluginType;
|
||||
std::unique_ptr< SCH_PLUGIN > m_plugin;
|
||||
std::unique_ptr< PROPERTIES > m_properties; ///< Library properties
|
||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library properties
|
||||
};
|
||||
|
||||
|
||||
|
@ -167,7 +167,7 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
|
||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( aFileType ) );
|
||||
bool res = true; // assume all libraries are successfully saved
|
||||
|
||||
PROPERTIES properties;
|
||||
STRING_UTF8_MAP properties;
|
||||
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
|
||||
|
||||
auto it = m_libs.find( aLibrary );
|
||||
@ -959,7 +959,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
|
||||
LIB_SYMBOL* originalSymbol = aSymbolBuf->GetOriginal();
|
||||
wxCHECK( libSymbol && originalSymbol, false );
|
||||
SYMBOL_LIB_TABLE::SAVE_T result;
|
||||
PROPERTIES properties;
|
||||
STRING_UTF8_MAP properties;
|
||||
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
|
||||
|
||||
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
|
||||
@ -1066,7 +1066,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
|
||||
wxString errorMsg = _( "Error saving symbol %s to library '%s'." ) + wxS( "\n%s" );
|
||||
|
||||
// set properties to prevent save file on every symbol save
|
||||
PROPERTIES properties;
|
||||
STRING_UTF8_MAP properties;
|
||||
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
|
||||
|
||||
// Delete the original symbol if the symbol name has been changed.
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <project.h>
|
||||
#include <properties.h>
|
||||
#include <string_utf8_map.h>
|
||||
#include <richio.h>
|
||||
|
||||
|
||||
@ -186,7 +186,7 @@ public:
|
||||
* Return the constant #PROPERTIES for this library (#LIB_TABLE_ROW). These are
|
||||
* the "options" in a table.
|
||||
*/
|
||||
const PROPERTIES* GetProperties() const { return properties.get(); }
|
||||
const STRING_UTF8_MAP* GetProperties() const { return properties.get(); }
|
||||
|
||||
/**
|
||||
* Serialize this object as utf8 text to an #OUTPUTFORMATTER, and tries to
|
||||
@ -218,7 +218,7 @@ protected:
|
||||
m_parent( aRow.m_parent )
|
||||
{
|
||||
if( aRow.properties )
|
||||
properties = std::make_unique<PROPERTIES>( *aRow.properties.get() );
|
||||
properties = std::make_unique<STRING_UTF8_MAP>( *aRow.properties.get() );
|
||||
else
|
||||
properties.reset();
|
||||
}
|
||||
@ -228,7 +228,7 @@ protected:
|
||||
private:
|
||||
virtual LIB_TABLE_ROW* do_clone() const = 0;
|
||||
|
||||
void setProperties( PROPERTIES* aProperties );
|
||||
void setProperties( STRING_UTF8_MAP* aProperties );
|
||||
|
||||
wxString nickName;
|
||||
wxString uri_user; ///< what user entered from UI or loaded from disk
|
||||
@ -245,7 +245,7 @@ private:
|
||||
bool m_loaded = false; ///< Whether the LIB_TABLE_ROW is loaded
|
||||
LIB_TABLE* m_parent; ///< Pointer to the table this row lives in (maybe null)
|
||||
|
||||
std::unique_ptr< PROPERTIES > properties;
|
||||
std::unique_ptr<STRING_UTF8_MAP> properties;
|
||||
|
||||
std::mutex m_loadMutex;
|
||||
};
|
||||
@ -506,7 +506,7 @@ public:
|
||||
* a library table, this formatting is handled for you.
|
||||
* </p>
|
||||
*/
|
||||
static PROPERTIES* ParseOptions( const std::string& aOptionsList );
|
||||
static STRING_UTF8_MAP* ParseOptions( const std::string& aOptionsList );
|
||||
|
||||
/**
|
||||
* Returns a list of options from the aProperties parameter.
|
||||
@ -518,7 +518,7 @@ public:
|
||||
* @param aProperties is the PROPERTIES to format or NULL. If NULL the returned
|
||||
* string will be empty.
|
||||
*/
|
||||
static UTF8 FormatOptions( const PROPERTIES* aProperties );
|
||||
static UTF8 FormatOptions( const STRING_UTF8_MAP* aProperties );
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@
|
||||
* A name/value tuple with unique names and optional values. The names
|
||||
* may be iterated alphabetically.
|
||||
*/
|
||||
class PROPERTIES : public std::map< std::string, UTF8 >
|
||||
class STRING_UTF8_MAP : public std::map< std::string, UTF8 >
|
||||
{
|
||||
public:
|
||||
bool Clear( const std::string& aProperty )
|
@ -79,7 +79,9 @@ public:
|
||||
if( m_choices.size() )
|
||||
{
|
||||
unsigned int row = 0;
|
||||
for( PROPERTIES::const_iterator it = m_choices.begin(); it != m_choices.end(); ++it, ++row )
|
||||
|
||||
for( STRING_UTF8_MAP::const_iterator it = m_choices.begin(); it != m_choices.end();
|
||||
++it, ++row )
|
||||
{
|
||||
wxString item = FROM_UTF8( it->first.c_str() );
|
||||
|
||||
@ -113,7 +115,7 @@ public:
|
||||
// Fill the grid with existing aOptions
|
||||
string options = TO_UTF8( m_callers_options );
|
||||
|
||||
PROPERTIES* props = LIB_TABLE::ParseOptions( options );
|
||||
STRING_UTF8_MAP* props = LIB_TABLE::ParseOptions( options );
|
||||
|
||||
if( props )
|
||||
{
|
||||
@ -121,7 +123,9 @@ public:
|
||||
m_grid->AppendRows( props->size() - m_grid->GetNumberRows() );
|
||||
|
||||
int row = 0;
|
||||
for( PROPERTIES::const_iterator it = props->begin(); it != props->end(); ++it, ++row )
|
||||
|
||||
for( STRING_UTF8_MAP::const_iterator it = props->begin(); it != props->end();
|
||||
++it, ++row )
|
||||
{
|
||||
m_grid->SetCellValue( row, 0, FROM_UTF8( it->first.c_str() ) );
|
||||
m_grid->SetCellValue( row, 1, it->second );
|
||||
@ -141,7 +145,7 @@ public:
|
||||
if( !DIALOG_SHIM::TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
PROPERTIES props;
|
||||
STRING_UTF8_MAP props;
|
||||
const int rowCount = m_grid->GetNumberRows();
|
||||
|
||||
for( int row = 0; row<rowCount; ++row )
|
||||
@ -162,7 +166,7 @@ public:
|
||||
private:
|
||||
const wxString& m_callers_options;
|
||||
wxString* m_result;
|
||||
PROPERTIES m_choices;
|
||||
STRING_UTF8_MAP m_choices;
|
||||
wxString m_initial_help;
|
||||
bool m_grid_widths_dirty;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user