KiCad PCB EDA Suite
append_board_to_current.cpp File Reference

append a board to the currently edited board. More...

#include <fctsys.h>
#include <confirm.h>
#include <properties.h>
#include <pcb_edit_frame.h>
#include <pcbnew.h>
#include <io_mgr.h>
#include <class_module.h>
#include <class_zone.h>
#include <class_board.h>
#include <pcb_draw_panel_gal.h>

Go to the source code of this file.

Functions

IO_MGR::PCB_FILE_T plugin_type (const wxString &aFileName, int aCtl)
 

Detailed Description

append a board to the currently edited board.

Definition in file append_board_to_current.cpp.

Function Documentation

◆ plugin_type()

IO_MGR::PCB_FILE_T plugin_type ( const wxString &  aFileName,
int  aCtl 
)

Definition at line 359 of file pcbnew/files.cpp.

360 {
361  IO_MGR::PCB_FILE_T pluginType;
362 
363  wxFileName fn = aFileName;
364 
365  // Note: file extensions are expected to be in ower case.
366  // This is not always true, especially when importing files, so the string
367  // comparisons are case insensitive to try to find the suitable plugin.
368 
369  if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::LEGACY ) ) == 0 )
370  {
371  // both legacy and eagle share a common file extension.
372  pluginType = ( aCtl & KICTL_EAGLE_BRD ) ? IO_MGR::EAGLE : IO_MGR::LEGACY;
373  }
374  else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::PCAD ) ) == 0 )
375  {
376  pluginType = IO_MGR::PCAD;
377  }
378  else
379  {
380  pluginType = IO_MGR::KICAD_SEXP;
381  }
382 
383  return pluginType;
384 }
#define KICTL_EAGLE_BRD
chosen *.brd file is Eagle according to user.
Definition: kiway_player.h:139
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:56
PCB_FILE_T
Enum PCB_FILE_T is a set of file types that the IO_MGR knows about, and for which there has been a pl...
Definition: io_mgr.h:54
S-expression Pcbnew file format.
Definition: io_mgr.h:57
static const wxString GetFileExtension(PCB_FILE_T aFileType)
Function GetFileExtension returns the file extension for aFileType.
Definition: io_mgr.cpp:109

Referenced by PCB_EDIT_FRAME::AppendBoardFile().