1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 09:27:59 +02:00

Add InvalidFileNameChars & InvalidPathChars to Path class

This commit is contained in:
disarray2077 2022-01-01 21:14:09 -03:00 committed by GitHub
parent 7a4a7bd2fb
commit bc92643c99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,38 @@ namespace System.IO
public const char8 VolumeSeparatorChar = '/'; public const char8 VolumeSeparatorChar = '/';
#endif //BF_PLATFORM_WINDOWS #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. // Make this public sometime.
// The max total path is 260, and the max individual component length is 255. // The max total path is 260, and the max individual component length is 255.
// For example, D:\<256 char file name> isn't legal, even though it's under 260 chars. // For example, D:\<256 char file name> isn't legal, even though it's under 260 chars.