KiCad PCB EDA Suite
FILE_NAME_CHAR_VALIDATOR Class Reference

This class provides a custom wxValidator object for limiting the allowable characters when defining footprint names. More...

#include <validators.h>

Inheritance diagram for FILE_NAME_CHAR_VALIDATOR:

Public Member Functions

 FILE_NAME_CHAR_VALIDATOR (wxString *aValue=NULL)
 

Detailed Description

This class provides a custom wxValidator object for limiting the allowable characters when defining footprint names.

Since the introduction of the PRETTY footprint library format, footprint names cannot have any characters that would prevent file creation on any platform. The characters \/:*?|"<> are illegal and filtered by the validator.

Definition at line 63 of file validators.h.

Constructor & Destructor Documentation

◆ FILE_NAME_CHAR_VALIDATOR()

FILE_NAME_CHAR_VALIDATOR::FILE_NAME_CHAR_VALIDATOR ( wxString *  aValue = NULL)

Definition at line 71 of file validators.cpp.

71  :
72  wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, aValue )
73 {
74  // The Windows (DOS) file system forbidden characters already include the forbidden
75  // file name characters for both Posix and OSX systems. The characters \/:*?|"<> are
76  // illegal and filtered by the validator.
77  wxString illegalChars = wxFileName::GetForbiddenChars( wxPATH_DOS );
78  wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST );
79  wxArrayString illegalCharList;
80 
81  for( unsigned i = 0; i < illegalChars.size(); i++ )
82  illegalCharList.Add( wxString( illegalChars[i] ) );
83 
84  SetExcludes( illegalCharList );
85  }
size_t i
Definition: json11.cpp:597

References i.


The documentation for this class was generated from the following files: