diff options
author | RedworkDE <10944644+RedworkDE@users.noreply.github.com> | 2023-03-06 21:39:24 +0100 |
---|---|---|
committer | RedworkDE <10944644+RedworkDE@users.noreply.github.com> | 2023-06-14 21:07:58 +0200 |
commit | 92f13ba9ea9f18425c36a2e738cc9102f6151fa9 (patch) | |
tree | d71271ab47994e12e826779b90523cebe85f6dfe /modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs | |
parent | 33957aee69683cf1f542a8622e5a9efd23070f1c (diff) | |
download | redot-engine-92f13ba9ea9f18425c36a2e738cc9102f6151fa9.tar.gz |
C#: Unify project name handling and fix issues with the handling of some special characters
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Diffstat (limited to 'modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs')
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs index 7c5502814f..d86a77d222 100644 --- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs +++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs @@ -57,27 +57,5 @@ namespace GodotTools.Core path.StartsWith("\\", StringComparison.Ordinal) || path.StartsWith(_driveRoot, StringComparison.Ordinal); } - - public static string ToSafeDirName(this string dirName, bool allowDirSeparator = false) - { - var invalidChars = new List<string> { ":", "*", "?", "\"", "<", ">", "|" }; - - if (allowDirSeparator) - { - // Directory separators are allowed, but disallow ".." to avoid going up the filesystem - invalidChars.Add(".."); - } - else - { - invalidChars.Add("/"); - } - - string safeDirName = dirName.Replace("\\", "/").Trim(); - - foreach (string invalidChar in invalidChars) - safeDirName = safeDirName.Replace(invalidChar, "-"); - - return safeDirName; - } } } |