summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/file/winfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/file/winfile.cpp')
-rw-r--r--src/osd/modules/file/winfile.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp
index c304259b915..1885925f9ee 100644
--- a/src/osd/modules/file/winfile.cpp
+++ b/src/osd/modules/file/winfile.cpp
@@ -14,6 +14,7 @@
#include "strconv.h"
#include "winutil.h"
#include "winutf8.h"
+#include "unicode.h"
// MAME headers
#include "osdcore.h"
@@ -466,6 +467,39 @@ const char *osd_get_volume_name(int idx)
//============================================================
+// osd_is_valid_filename_char
+//============================================================
+
+bool osd_is_valid_filename_char(unicode_char uchar)
+{
+ return osd_is_valid_filepath_char(uchar)
+ && uchar != '/'
+ && uchar != '\\'
+ && uchar != ':';
+}
+
+
+
+//============================================================
+// osd_is_valid_filepath_char
+//============================================================
+
+bool osd_is_valid_filepath_char(unicode_char uchar)
+{
+ return uchar >= 0x20
+ && uchar != '<'
+ && uchar != '>'
+ && uchar != '\"'
+ && uchar != '|'
+ && uchar != '?'
+ && uchar != '*'
+ && !(uchar >= '\x7F' && uchar <= '\x9F')
+ && uchar_isvalid(uchar);
+}
+
+
+
+//============================================================
// win_error_to_file_error
//============================================================