23 #include <wx/filename.h> 35 #define FMT_UNIMPLEMENTED _( "Plugin \"%s\" does not implement the \"%s\" function." ) 36 #define FMT_NOTFOUND _( "Plugin type \"%s\" is not found." ) 52 SCH_PLUGIN* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType )
64 default:
return nullptr;
87 case SCH_LEGACY:
return wxString( wxT(
"Legacy" ) );
88 case SCH_KICAD:
return wxString( wxT(
"KiCad" ) );
89 case SCH_ALTIUM:
return wxString( wxT(
"Altium" ) );
90 case SCH_CADSTAR_ARCHIVE:
return wxString( wxT(
"CADSTAR Schematic Archive" ) );
91 case SCH_EAGLE:
return wxString( wxT(
"EAGLE" ) );
104 if( aType == wxT(
"Legacy" ) )
106 else if( aType == wxT(
"KiCad" ) )
108 else if( aType == wxT(
"Altium" ) )
110 else if( aType == wxT(
"CADSTAR Schematic Archive" ) )
111 return SCH_CADSTAR_ARCHIVE;
112 else if( aType == wxT(
"EAGLE" ) )
117 return SCH_FILE_T( -1 );
123 wxString ext = wxEmptyString;
126 if( plugin !=
nullptr )
138 wxString ext = wxEmptyString;
141 if( plugin !=
nullptr )
153 SCH_FILE_T ret = SCH_KICAD;
154 wxFileName fn( aLibPath );
171 SCH_FILE_T ret = SCH_KICAD;
172 wxFileName fn( aSchematicPath );
A factory which returns an instance of a SCH_PLUGIN.
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath)
Return a plugin type given a symbol library using the file extension of aLibPath.
virtual const wxString GetLibraryFileExtension() const =0
Return the library file extension for the SCH_PLUGIN object.
const std::string LegacySymbolLibFileExtension
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.
A SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
static SCH_FILE_T GuessPluginTypeFromSchPath(const wxString &aSchematicPath)
Return a plugin type given a schematic using the file extension of aSchematicPath.
Base class that schematic file and library loading and saving plugins should derive from.
#define DECLARE_ENUM_VECTOR(class_name, enum_name)
static const wxString GetFileExtension(SCH_FILE_T aFileType)
Return the schematic file extension for aFileType.
Definition of file extensions used in Kicad.
SCH_ALTIUM_PLUGIN is a SCH_PLUGIN derivation for loading Altium .SchDoc schematic files.
const std::string LegacySchematicFileExtension
A SCH_PLUGIN derivation for loading schematic files using the new s-expression file format.
A SCH_PLUGIN derivation for loading schematic files created before the new s-expression file format.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
static SCH_FILE_T EnumFromStr(const wxString &aFileType)
Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy",...
const std::string KiCadSchematicFileExtension
virtual const wxString GetFileExtension() const =0
Return the file extension for the SCH_PLUGIN.
static void ReleasePlugin(SCH_PLUGIN *aPlugin)
Release a SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
const std::string KiCadSymbolLibFileExtension