KiCad PCB EDA Suite
FILE_NAME_WITH_PATH_CHAR_VALIDATOR Class Reference

Class FILE_NAME_WITH_PATH_CHAR_VALIDATOR. 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

Class FILE_NAME_WITH_PATH_CHAR_VALIDATOR.

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 78 of file validators.h.

Constructor & Destructor Documentation

FILE_NAME_WITH_PATH_CHAR_VALIDATOR::FILE_NAME_WITH_PATH_CHAR_VALIDATOR ( wxString *  aValue = NULL)

Definition at line 86 of file validators.cpp.

References i.

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

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