KiCad PCB EDA Suite
File Extension Definitions

Macros

#define PcbFileExtension   KiCadPcbFileExtension
 

Functions

wxString AddFileExtListToFilter (const std::vector< std::string > &aExts)
 Build the wildcard extension file dialog wildcard filter to add to the base message dialog. More...
 
wxString formatWildcardExt (const wxString &aWildcard)
 Format wildcard extension to support case sensitive file dialogs. More...
 

Variables

const std::string SchematicSymbolFileExtension
 
const std::string SchematicLibraryFileExtension
 
const std::string SchematicBackupFileExtension
 
const std::string VrmlFileExtension
 
const std::string ProjectFileExtension
 
const std::string SchematicFileExtension
 
const std::string NetlistFileExtension
 
const std::string GerberFileExtension
 
const std::string GerberJobFileExtension
 
const std::string HtmlFileExtension
 
const std::string EquFileExtension
 
const std::string LegacyPcbFileExtension
 
const std::string KiCadPcbFileExtension
 
const std::string PageLayoutDescrFileExtension
 
const std::string LegacyFootprintLibPathExtension
 
const std::string PdfFileExtension
 
const std::string MacrosFileExtension
 
const std::string ComponentFileExtension
 
const std::string DrillFileExtension
 
const std::string SVGFileExtension
 
const std::string ReportFileExtension
 
const std::string FootprintPlaceFileExtension
 
const std::string KiCadFootprintFileExtension
 
const std::string KiCadFootprintLibPathExtension
 
const std::string GedaPcbFootprintLibFileExtension
 
const std::string EagleFootprintLibPathExtension
 
const std::string KiCadLib3DShapesPathExtension
 
const std::string SpecctraDsnFileExtension
 
const std::string IpcD356FileExtension
 
const std::string PngFileExtension
 
const std::string JpegFileExtension
 

Detailed Description

Note
Please do not changes these. If a different file extension is needed, create a new definition in here. If you create a extension definition in another file, make sure to add it to the Doxygen group "file_extensions" using the "addtogroup" tag. Also note, just because they are defined as const doesn't guarantee that they cannot be changed.

Macro Definition Documentation

◆ PcbFileExtension

#define PcbFileExtension   KiCadPcbFileExtension

Definition at line 111 of file wildcards_and_files_ext.h.

Function Documentation

◆ AddFileExtListToFilter()

wxString AddFileExtListToFilter ( const std::vector< std::string > &  aExts)

Build the wildcard extension file dialog wildcard filter to add to the base message dialog.

For instance, to open .txt files in a file dialog: the base message is for instance "Text files" the ext list is " (*.txt)|*.txt" and the returned string to add to the base message is " (*.txt)|*.txt" the message to display in the dialog is "Text files (*.txt)|*.txt"

This function produces a case-insensitive filter (so .txt, .TXT and .tXT are all match if you pass "txt" into the function).

Parameters
aExtsis the list of exts to add to the filter. Do not include the leading dot. Empty means "allow all files".
Returns
the appropriate file dialog wildcard filter list.

Definition at line 55 of file wildcards_and_files_ext.cpp.

56 {
57  if( aExts.size() == 0 )
58  {
59  // The "all files" wildcard is different on different systems
60  wxString filter;
61  filter << " (" << wxFileSelectorDefaultWildcardStr << ")|"
62  << wxFileSelectorDefaultWildcardStr;
63  return filter;
64  }
65 
66  wxString files_filter = " (";
67 
68  // Add extensions to the info message:
69  for( const auto& ext : aExts )
70  {
71  files_filter << " *." << ext;
72  }
73 
74  files_filter << ")|*.";
75 
76  // Add extensions to the filter list, using a formated string (GTK specific):
77  bool first = true;
78  for( const auto& ext : aExts )
79  {
80  if( !first )
81  files_filter << ";*.";
82 
83  first = false;
84 
85  files_filter << formatWildcardExt( ext );
86  }
87 
88  return files_filter;
89 }
wxString formatWildcardExt(const wxString &aWildcard)
Format wildcard extension to support case sensitive file dialogs.

References formatWildcardExt().

Referenced by AllFilesWildcard(), CadstarNetlistFileWildcard(), ComponentFileWildcard(), CsvFileWildcard(), DrillFileWildcard(), DxfFileWildcard(), EagleFilesWildcard(), EagleFootprintLibPathWildcard(), EaglePcbFileWildcard(), EagleSchematicFileWildcard(), EquFileWildcard(), ErcFileWildcard(), FootprintPlaceFileWildcard(), GedaPcbFootprintLibFileWildcard(), GencadFileWildcard(), GerberFileWildcard(), GerberJobFileWildcard(), HtmlFileWildcard(), IDF3DFileWildcard(), IpcD356FileWildcard(), JpegFileWildcard(), KiCadFootprintLibFileWildcard(), KiCadFootprintLibPathWildcard(), LegacyFootprintLibPathWildcard(), LegacyPcbFileWildcard(), ModLegacyExportFileWildcard(), NetlistFileWildcard(), DIALOG_SELECT_NET_FROM_LIST::onReport(), PageLayoutDescrFileWildcard(), PCadPcbFileWildcard(), PcbFileWildcard(), PdfFileWildcard(), PngFileWildcard(), ProjectFileWildcard(), PSFileWildcard(), ReportFileWildcard(), SchematicFileWildcard(), SchematicLibraryFileWildcard(), SchematicSymbolFileWildcard(), Shapes3DFileWildcard(), SpecctraDsnFileWildcard(), SpiceLibraryFileWildcard(), SpiceNetlistFileWildcard(), SVGFileWildcard(), TextFileWildcard(), WorkbookFileWildcard(), and ZipFileWildcard().

◆ formatWildcardExt()

wxString formatWildcardExt ( const wxString &  aWildcard)

Format wildcard extension to support case sensitive file dialogs.

The file extension wildcards of the GTK+ file dialog are case sensitive so using all lower case characters means that only file extensions that are all lower case will show up in the file dialog. The GTK+ file dialog does support regular expressions so the file extension is converted to a regular expression ( sch -> [sS][cC][hH] ) when wxWidgets is built against GTK+. Please make sure you call this function when adding new file wildcards.

Note
When calling wxFileDialog with a default file defined, make sure you include the file extension along with the file name. Otherwise, on GTK+ builds, the file dialog will append the wildcard regular expression as the file extension which is surely not what you want.
Parameters
aWildcardis the extension part of the wild card.
Returns
the build appropriate file dialog wildcard filter.

Definition at line 33 of file wildcards_and_files_ext.cpp.

34 {
35  wxString wc;
36 #if defined( __WXGTK__ )
37 
38  for( auto ch : aWildcard )
39  {
40  if( wxIsalpha( ch ) )
41  wc += wxString::Format( "[%c%c]", wxTolower( ch ), wxToupper( ch ) );
42  else
43  wc += ch;
44  }
45 
46  return wc;
47 #else
48  wc = aWildcard;
49 
50  return wc;
51 #endif
52 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format().

Referenced by AddFileExtListToFilter(), SVG_IMPORT_PLUGIN::GetFileExtensions(), and DXF_IMPORT_PLUGIN::GetFileExtensions().

Variable Documentation

◆ ComponentFileExtension

const std::string ComponentFileExtension

◆ DrillFileExtension

◆ EagleFootprintLibPathExtension

const std::string EagleFootprintLibPathExtension

◆ EquFileExtension

const std::string EquFileExtension

◆ FootprintPlaceFileExtension

const std::string FootprintPlaceFileExtension

◆ GedaPcbFootprintLibFileExtension

const std::string GedaPcbFootprintLibFileExtension

◆ GerberFileExtension

const std::string GerberFileExtension

◆ GerberJobFileExtension

const std::string GerberJobFileExtension

◆ HtmlFileExtension

const std::string HtmlFileExtension

◆ IpcD356FileExtension

const std::string IpcD356FileExtension

◆ JpegFileExtension

const std::string JpegFileExtension

◆ KiCadFootprintFileExtension

◆ KiCadFootprintLibPathExtension

◆ KiCadLib3DShapesPathExtension

const std::string KiCadLib3DShapesPathExtension

◆ KiCadPcbFileExtension

◆ LegacyFootprintLibPathExtension

const std::string LegacyFootprintLibPathExtension

◆ LegacyPcbFileExtension

◆ MacrosFileExtension

const std::string MacrosFileExtension

◆ NetlistFileExtension

const std::string NetlistFileExtension

◆ PageLayoutDescrFileExtension

const std::string PageLayoutDescrFileExtension

◆ PdfFileExtension

const std::string PdfFileExtension

◆ PngFileExtension

const std::string PngFileExtension

◆ ProjectFileExtension

◆ ReportFileExtension

◆ SchematicBackupFileExtension

const std::string SchematicBackupFileExtension

◆ SchematicFileExtension

◆ SchematicLibraryFileExtension

◆ SchematicSymbolFileExtension

const std::string SchematicSymbolFileExtension

◆ SpecctraDsnFileExtension

const std::string SpecctraDsnFileExtension

◆ SVGFileExtension

const std::string SVGFileExtension

◆ VrmlFileExtension

const std::string VrmlFileExtension