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 <wxPcbStruct.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

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

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

Referenced by PCB_EDIT_FRAME::AppendBoardFile().

375 {
376  IO_MGR::PCB_FILE_T pluginType;
377 
378  wxFileName fn = aFileName;
379 
380  // Note: file extensions are expected to be in ower case.
381  // This is not always true, especially when importing files, so the string
382  // comparisons are case insensitive to try to find the suitable plugin.
383 
384  if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::LEGACY ) ) == 0 )
385  {
386  // both legacy and eagle share a common file extension.
387  pluginType = ( aCtl & KICTL_EAGLE_BRD ) ? IO_MGR::EAGLE : IO_MGR::LEGACY;
388  }
389  else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::LEGACY ) + backupSuffix ) == 0 )
390  {
391  pluginType = IO_MGR::LEGACY;
392  }
393  else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::PCAD ) ) == 0 )
394  {
395  pluginType = IO_MGR::PCAD;
396  }
397  else
398  {
399  pluginType = IO_MGR::KICAD_SEXP;
400  }
401 
402  return pluginType;
403 }
#define KICTL_EAGLE_BRD
chosen *.brd file is Eagle according to user.
Definition: kiway_player.h:130
static const wxChar backupSuffix[]
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:53
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:51
S-expression Pcbnew file format.
Definition: io_mgr.h:54
static const wxString GetFileExtension(PCB_FILE_T aFileType)
Function GetFileExtension returns the file extension for aFileType.
Definition: io_mgr.cpp:117