32#include <wx/filedlg.h>
34#include <wx/translation.h>
38 const std::vector<std::string>& aReference,
bool aCaseSensitive )
41 std::string regexString =
"(";
44 for(
const std::string& ext : aReference )
58 std::regex extRegex( regexString, aCaseSensitive ? std::regex::ECMAScript : std::regex::icase );
59 return std::regex_match( aExtension, extRegex );
66#if defined( __WXGTK__ )
68 for(
const auto& ch : aWildcard )
71 wc += wxString::Format(
"[%c%c]", wxTolower( ch ), wxToupper( ch ) );
87 if( aExts.size() == 0 )
91 filter << wxS(
" (" ) << wxFileSelectorDefaultWildcardStr << wxS(
")|" )
92 << wxFileSelectorDefaultWildcardStr;
96 wxString files_filter = wxS(
" (" );
99 for(
const std::string& ext : aExts )
101 if( files_filter.length() > 2 )
102 files_filter << wxS(
"; " );
104 files_filter <<
"*." << ext;
107 files_filter << wxS(
")|*." );
112 for(
const std::string& ext : aExts )
115 files_filter << wxS(
";*." );
229 return gerberRE.Matches( ext );
241 return _(
"KiCad symbol library files" )
254 return _(
"KiCad legacy project files" )
261 return _(
"All KiCad project files" )
268 return _(
"All KiCad schematic files" )
275 return _(
"KiCad legacy schematic files" )
282 return _(
"KiCad s-expression schematic files" )
301 return _(
"OrcadPCB2 netlist files" )
314 return _(
"Allegro netlist files" )
339 return _(
"KiCad printed circuit board files" )
352 return _(
"KiCad footprint library paths" )
359 return _(
"KiCad design block path" )
366 return _(
"KiCad design block library paths" )
373 return _(
"Drawing sheet files" )
381 return _(
"KiCad symbol footprint link files" )
389 return _(
"Drill files" )
522 return _(
"Specctra DSN file" )
529 return _(
"Specctra Session file" )
536 return _(
"IPC-D-356 Test Files" )
543 return _(
"Workbook file" )
static const std::string CadstarNetlistFileExtension
static const std::string LegacySchematicFileExtension
static const std::string KiCadDesignBlockLibPathExtension
static const std::string HtmlFileExtension
static const wxString GerberFileExtensionsRegex
static const std::string BrepFileExtension
static const std::string CadstarPartsLibraryFileExtension
static const std::string NetlistFileExtension
static const std::string KiCadDesignBlockPathExtension
static const std::string SymbolLibraryTableFileName
static const std::string JpegFileExtension
static const std::string GerberJobFileExtension
static const std::string StepFileAbrvExtension
static const std::string GerberFileExtension
static const std::string XaoFileExtension
static const std::string WorkbookFileExtension
static const std::string ReportFileExtension
static const std::string GltfBinaryFileExtension
static const std::string EquFileExtension
static const std::string LockFileExtension
static const std::string ProjectFileExtension
static const std::string PngFileExtension
static const std::string FootprintPlaceFileExtension
static const std::string JsonFileExtension
static const std::string AltiumFootprintLibPathExtension
static const std::string LegacyPcbFileExtension
static const std::string SchematicSymbolFileExtension
static const std::string XmlFileExtension
static const std::string LegacyProjectFileExtension
static const std::string ProjectLocalSettingsFileExtension
static const std::string EagleFootprintLibPathExtension
static const std::string KiCadSchematicFileExtension
static const std::string OrCadPcb2NetlistFileExtension
static const std::string LegacySymbolLibFileExtension
static const std::string KiCadUriPrefix
static const std::string DesignBlockLibraryTableFileName
static const std::string LockFilePrefix
static const std::string CsvFileExtension
static const std::string KiCadSymbolLibFileExtension
static const std::string SpiceFileExtension
static const std::string PdfFileExtension
static const std::string TextFileExtension
static const std::string Ipc2581FileExtension
static const std::string FootprintLibraryTableFileName
static const std::string PADSNetlistFileExtension
static const std::string GencadFileExtension
static const std::string StlFileExtension
static const std::string DrawingSheetFileExtension
static const std::string BackupFileSuffix
static const std::string AutoSaveFilePrefix
static const std::string IbisFileExtension
static const std::string IpcD356FileExtension
static const std::string KiCadJobSetFileExtension
static const std::string CadstarFootprintLibPathExtension
static const std::string GedaPcbFootprintLibFileExtension
static const std::string DatabaseLibraryFileExtension
static const std::string LegacyFootprintLibPathExtension
static const std::string CadstarSchematicFileExtension
static const std::string PlyFileExtension
static const std::string PythonFileExtension
static const std::string SpecctraDsnFileExtension
static const std::string StepFileExtension
static const std::string LegacySymbolDocumentFileExtension
static const std::string KiCadFootprintLibPathExtension
static const std::string FootprintAssignmentFileExtension
static const std::string SVGFileExtension
static const std::string EaglePcbFileExtension
static const std::string SpecctraSessionFileExtension
static const std::string HTTPLibraryFileExtension
static const std::string DrillFileExtension
static const std::string SpiceSubcircuitFileExtension
static const std::string MacrosFileExtension
static const std::string HotkeyFileExtension
static const std::string CadstarPcbFileExtension
static const std::string SpiceModelFileExtension
static const std::string DesignRulesFileExtension
static const std::string VrmlFileExtension
static const std::string MarkdownFileExtension
static const std::string KiCadFootprintFileExtension
static const std::string ArchiveFileExtension
static const std::string AllegroNetlistFileExtension
static const std::string KiCadPcbFileExtension
static wxString ProjectFileWildcard()
static wxString SpiceNetlistFileWildcard()
static wxString PngFileWildcard()
static wxString HotkeyFileWildcard()
static wxString EasyEdaArchiveWildcard()
static wxString ModLegacyExportFileWildcard()
static wxString FootprintPlaceFileWildcard()
static wxString ErcFileWildcard()
static wxString JpegFileWildcard()
static wxString OrCadPcb2NetlistFileWildcard()
static wxString AllFilesWildcard()
static wxString AllegroNetlistFileWildcard()
static wxString CadstarArchiveFilesWildcard()
static wxString SpecctraSessionFileWildcard()
static wxString TextFileWildcard()
static wxString CadstarNetlistFileWildcard()
static wxString KiCadDesignBlockLibPathWildcard()
static wxString EasyEdaProFileWildcard()
static wxString LegacySchematicFileWildcard()
static wxString DxfFileWildcard()
static wxString PdfFileWildcard()
static wxString KiCadDesignBlockPathWildcard()
static wxString SVGFileWildcard()
static wxString PADSNetlistFileWildcard()
static bool IsGerberFileExtension(const wxString &ext)
static wxString SpiceLibraryFileWildcard()
static wxString GerberJobFileWildcard()
static wxString JsonFileWildcard()
static wxString PcbFileWildcard()
static wxString KiCadSymbolLibFileWildcard()
static wxString KiCadFootprintLibFileWildcard()
static wxString KiCadFootprintLibPathWildcard()
static wxString NetlistFileWildcard()
static wxString PSFileWildcard()
static wxString EquFileWildcard()
static wxString AllSchematicFilesWildcard()
static wxString IDF3DFileWildcard()
static wxString HtmlFileWildcard()
static wxString SpecctraDsnFileWildcard()
static wxString DrawingSheetFileWildcard()
static wxString DrillFileWildcard()
static wxString FootprintAssignmentFileWildcard()
static wxString Shapes3DFileWildcard()
static wxString EagleFilesWildcard()
static wxString JobsetFileWildcard()
static wxString LegacyProjectFileWildcard()
static wxString IpcD356FileWildcard()
static wxString CsvFileWildcard()
static wxString AllProjectFilesWildcard()
static wxString KiCadSchematicFileWildcard()
static wxString GencadFileWildcard()
static wxString ReportFileWildcard()
static wxString ZipFileWildcard()
static wxString WorkbookFileWildcard()
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
wxString formatWildcardExt(const wxString &aWildcard)
Format wildcard extension to support case sensitive file dialogs.
bool compareFileExtensions(const std::string &aExtension, const std::vector< std::string > &aReference, bool aCaseSensitive)
Compare the given extension against the reference extensions to see if it matches any of the referenc...
Definition of file extensions used in Kicad.
KICOMMON_API wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.