106 std::function<
PCB_IO*(
void)> aCreateFunc )
119 if ( ent.m_type == aFileType )
121 return ent.m_createFunc();
149 std::function<
PCB_IO*(
void)> aCreateFunc )
207 BOARD* aAppendToMe =
nullptr,
const std::map<std::string, UTF8>* aProperties =
nullptr,
231 const std::map<std::string, UTF8>* aProperties =
nullptr );
236 static bool ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps,
const wxString& aOldFilePath,
237 const wxString& aNewFilePath,
REPORTER* aReporter );
Information pertinent to a Pcbnew printed circuit board.
Hold a list of available plugins, created using a singleton REGISTER_PLUGIN object.
PCB_IO * Create(PCB_FILE_T aFileType) const
const std::vector< ENTRY > & AllPlugins() const
void Register(PCB_FILE_T aType, const wxString &aName, std::function< PCB_IO *(void)> aCreateFunc)
static PLUGIN_REGISTRY * Instance()
std::vector< ENTRY > m_plugins
A factory which returns an instance of a #PLUGIN.
static PCB_IO * PluginFind(PCB_FILE_T aFileType)
Return a #PLUGIN which the caller can use to import, export, save, or load design documents.
static BOARD * Load(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Find the requested #PLUGIN and if found, calls the #PLUGIN::LoadBoard() function on it using the argu...
static PCB_FILE_T EnumFromStr(const wxString &aFileType)
Return the PCB_FILE_T from the corresponding plugin type name: "kicad", "legacy", etc.
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
@ KICAD_SEXP
S-expression Pcbnew file format.
@ GEDA_PCB
Geda PCB file formats.
@ LEGACY
Legacy Pcbnew file formats prior to s-expression.
@ PCB_FILE_UNKNOWN
0 is not a legal menu id on Mac
static bool ConvertLibrary(std::map< std::string, UTF8 > *aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilePath, REPORTER *aReporter)
Convert a schematic symbol library to the latest KiCad format.
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
static void Save(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr)
Write either a full aBoard to a storage file in a format that this implementation knows about,...
static PCB_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath, int aCtl=0)
Return a plugin type given a footprint library's libPath.
static const wxString ShowType(PCB_FILE_T aFileType)
Return a brief name for a plugin given aFileType enum.
A base class that BOARD loading and saving plugins should derive from.
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
Some functions to handle hotkeys in KiCad.
std::function< PCB_IO *(void)> m_createFunc
REGISTER_PLUGIN(PCB_FILE_T aType, const wxString &aName, std::function< PCB_IO *(void)> aCreateFunc)