KiCad PCB EDA Suite
FILE_NAME_WITH_PATH_CHAR_VALIDATOR Class Reference

This class provides a custom wxValidator object for limiting the allowable characters when defining file names with path, for instance in schematic sheet file names. More...

#include <validators.h>

Inheritance diagram for FILE_NAME_WITH_PATH_CHAR_VALIDATOR:

Public Member Functions

 FILE_NAME_WITH_PATH_CHAR_VALIDATOR (wxString *aValue=NULL)
 

Detailed Description

This class provides a custom wxValidator object for limiting the allowable characters when defining file names with path, for instance in schematic sheet file names.

The characters *?|"<> are illegal and filtered by the validator, but /\: are valid (\ and : only on Windows.)

Definition at line 76 of file validators.h.

Constructor & Destructor Documentation

◆ FILE_NAME_WITH_PATH_CHAR_VALIDATOR()

FILE_NAME_WITH_PATH_CHAR_VALIDATOR::FILE_NAME_WITH_PATH_CHAR_VALIDATOR ( wxString *  aValue = NULL)

Definition at line 88 of file validators.cpp.

88  :
89  wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST | wxFILTER_EMPTY, aValue )
90 {
91  // The Windows (DOS) file system forbidden characters already include the forbidden
92  // file name characters for both Posix and OSX systems. The characters *?|"<> are
93  // illegal and filtered by the validator, but /\: are valid (\ and : only on Windows.
94  wxString illegalChars = wxFileName::GetForbiddenChars( wxPATH_DOS );
95  wxTextValidator nameValidator( wxFILTER_EXCLUDE_CHAR_LIST );
96  wxArrayString illegalCharList;
97 
98  for( unsigned i = 0; i < illegalChars.size(); i++ )
99  {
100  if( illegalChars[i] == '/' )
101  continue;
102 
103 #if defined (__WINDOWS__)
104  if( illegalChars[i] == '\\' || illegalChars[i] == ':' )
105  continue;
106 #endif
107  illegalCharList.Add( wxString( illegalChars[i] ) );
108  }
109 
110  SetExcludes( illegalCharList );
111 }
size_t i
Definition: json11.cpp:597

References i.


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