about summary refs log tree commit diff
path: root/IrcStates/Casemap.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-05-14 23:06:10 -0400
committerBen Harris <ben@tilde.team>2020-05-14 23:17:47 -0400
commit21f1e95fb8e935134a969bc3d729964d8d2aadfa (patch)
treedb2be27e9b5ac48e19f92b56cbad68ab59f7099e /IrcStates/Casemap.cs
parent304df7805b9925c2edd992fd4177eef80197f807 (diff)
rename Irc to IRC
Diffstat (limited to 'IrcStates/Casemap.cs')
-rw-r--r--IrcStates/Casemap.cs38
1 files changed, 0 insertions, 38 deletions
diff --git a/IrcStates/Casemap.cs b/IrcStates/Casemap.cs
deleted file mode 100644
index 67867c5..0000000
--- a/IrcStates/Casemap.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-
-namespace IrcStates
-{
-    public static class Casemap
-    {
-        public enum CaseMapping
-        {
-            Rfc1459,
-            Ascii
-        }
-
-        private const string AsciiUpperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-        private const string AsciiLowerChars = "abcdefghijklmnopqrstuvwxyz";
-        private const string Rfc1459UpperChars = AsciiUpperChars + @"[]~\";
-        private const string Rfc1459LowerChars = AsciiLowerChars + @"{}^|";
-
-        private static string Replace(string s, string upper, string lower)
-        {
-            for (var i = 0; i < upper.Length; ++i) s = s.Replace(upper[i], lower[i]);
-
-            return s;
-        }
-
-        public static string CaseFold(CaseMapping mapping, string s)
-        {
-            if (s != null)
-                return mapping switch
-                {
-                    CaseMapping.Rfc1459 => Replace(s, Rfc1459UpperChars, Rfc1459LowerChars),
-                    CaseMapping.Ascii   => Replace(s, AsciiUpperChars, AsciiLowerChars),
-                    _                   => throw new ArgumentOutOfRangeException(nameof(mapping), mapping, null)
-                };
-
-            return string.Empty;
-        }
-    }
-}