23#include <wx/filename.h>
36#define FMT_UNIMPLEMENTED _( "Plugin \"%s\" does not implement the \"%s\" function." )
37#define FMT_NOTFOUND _( "Plugin type \"%s\" is not found." )
53SCH_PLUGIN* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType )
66 default:
return nullptr;
89 case SCH_LEGACY:
return wxString( wxT(
"Legacy" ) );
90 case SCH_KICAD:
return wxString( wxT(
"KiCad" ) );
91 case SCH_ALTIUM:
return wxString( wxT(
"Altium" ) );
92 case SCH_CADSTAR_ARCHIVE:
return wxString( wxT(
"CADSTAR Schematic Archive" ) );
93 case SCH_EAGLE:
return wxString( wxT(
"EAGLE" ) );
94 case SCH_DATABASE:
return wxString( wxT(
"Database" ) );
107 if( aType == wxT(
"Legacy" ) )
109 else if( aType == wxT(
"KiCad" ) )
111 else if( aType == wxT(
"Altium" ) )
113 else if( aType == wxT(
"CADSTAR Schematic Archive" ) )
114 return SCH_CADSTAR_ARCHIVE;
115 else if( aType == wxT(
"EAGLE" ) )
117 else if( aType == wxT(
"Database" ) )
122 return SCH_FILE_T( -1 );
128 wxString ext = wxEmptyString;
131 if( plugin !=
nullptr )
143 wxString ext = wxEmptyString;
146 if( plugin !=
nullptr )
158 SCH_FILE_T ret = SCH_KICAD;
159 wxFileName fn( aLibPath );
176 SCH_FILE_T ret = SCH_KICAD;
177 wxFileName fn( aSchematicPath );
SCH_ALTIUM_PLUGIN is a SCH_PLUGIN derivation for loading Altium .SchDoc schematic files.
A KiCad database library provides both symbol and footprint metadata, so there are "shim" plugins on ...
A SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
A factory which returns an instance of a SCH_PLUGIN.
static SCH_FILE_T EnumFromStr(const wxString &aFileType)
Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy",...
static const wxString GetFileExtension(SCH_FILE_T aFileType)
Return the schematic file extension for aFileType.
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
static const wxString GetLibraryFileExtension(SCH_FILE_T aFileType)
Return the symbol library file extension (if any) for aFileType.
static void ReleasePlugin(SCH_PLUGIN *aPlugin)
Release a SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
static SCH_FILE_T GuessPluginTypeFromSchPath(const wxString &aSchematicPath)
Return a plugin type given a schematic using the file extension of aSchematicPath.
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Return a plugin type given a symbol library using the file extension of aLibPath.
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
Base class that schematic file and library loading and saving plugins should derive from.
virtual const wxString GetLibraryFileExtension() const =0
Return the library file extension for the SCH_PLUGIN object.
virtual const wxString GetFileExtension() const =0
Return the file extension for the SCH_PLUGIN.
A SCH_PLUGIN derivation for loading schematic files using the new s-expression file format.
#define DECLARE_ENUM_VECTOR(className, enumName)
const std::string KiCadSymbolLibFileExtension
const std::string LegacySchematicFileExtension
const std::string KiCadSchematicFileExtension
const std::string LegacySymbolLibFileExtension
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition of file extensions used in Kicad.