From bc92643c99695b0caa41c0e32e210861a904f3ec Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Sat, 1 Jan 2022 21:14:09 -0300 Subject: [PATCH] Add InvalidFileNameChars & InvalidPathChars to Path class --- BeefLibs/corlib/src/IO/Path.bf | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/BeefLibs/corlib/src/IO/Path.bf b/BeefLibs/corlib/src/IO/Path.bf index 270f345c..00a69c41 100644 --- a/BeefLibs/corlib/src/IO/Path.bf +++ b/BeefLibs/corlib/src/IO/Path.bf @@ -34,6 +34,38 @@ namespace System.IO #else public const char8 VolumeSeparatorChar = '/'; #endif //BF_PLATFORM_WINDOWS + +#if BF_PLATFORM_WINDOWS + public static readonly char8[?] InvalidFileNameChars = + .( + '\"', '<', '>', '|', '\0', + (.)1, (.)2, (.)3, (.)4, (.)5, (.)6, (.)7, (.)8, (.)9, (.)10, + (.)11, (.)12, (.)13, (.)14, (.)15, (.)16, (.)17, (.)18, (.)19, (.)20, + (.)21, (.)22, (.)23, (.)24, (.)25, (.)26, (.)27, (.)28, (.)29, (.)30, + (.)31, ':', '*', '?', '\\', '/' + ); +#else + public static readonly char8[?] InvalidFileNameChars = + .( + '\0', '/' + ); +#endif //BF_PLATFORM_WINDOWS + +#if BF_PLATFORM_WINDOWS + public static readonly char8[?] InvalidPathChars = + .( + '|', '\0', + (.)1, (.)2, (.)3, (.)4, (.)5, (.)6, (.)7, (.)8, (.)9, (.)10, + (.)11, (.)12, (.)13, (.)14, (.)15, (.)16, (.)17, (.)18, (.)19, (.)20, + (.)21, (.)22, (.)23, (.)24, (.)25, (.)26, (.)27, (.)28, (.)29, (.)30, + (.)31 + ); +#else + public static readonly char8[?] InvalidPathChars = + .( + '\0' + ); +#endif //BF_PLATFORM_WINDOWS // Make this public sometime. // The max total path is 260, and the max individual component length is 255.