diff options
author | Adam <Adam@anope.org> | 2014-12-29 17:26:20 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-12-29 17:26:20 -0500 |
commit | 8ab1c71d7dc7a0d47e5711dc72e3fc9c3ee850bb (patch) | |
tree | d65f46a60e49d51ee1f0192de22c35e3cdd322c9 /include/hashcomp.h | |
parent | ed920366d69801bab7fc276fa24296b7f1264ff2 (diff) |
Allow configuring casemaps
Diffstat (limited to 'include/hashcomp.h')
-rw-r--r-- | include/hashcomp.h | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h index 2364975b9..a9a1105ee 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -19,56 +19,8 @@ namespace Anope { class string; - /* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */ - extern std::locale casemap; - - extern void CaseMapRebuild(); extern unsigned char tolower(unsigned char); extern unsigned char toupper(unsigned char); - - /* ASCII case insensitive ctype. */ - template<typename char_type> - class ascii_ctype : public std::ctype<char_type> - { - public: - char_type do_toupper(char_type c) const override - { - if (c >= 'a' && c <= 'z') - return c - 32; - else - return c; - } - - char_type do_tolower(char_type c) const override - { - if (c >= 'A' && c <= 'Z') - return c + 32; - else - return c; - } - }; - - /* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */ - template<typename char_type> - class rfc1459_ctype : public ascii_ctype<char_type> - { - public: - char_type do_toupper(char_type c) const override - { - if (c == '{' || c == '}' || c == '|') - return c - 32; - else - return ascii_ctype<char_type>::do_toupper(c); - } - - char_type do_tolower(char_type c) const override - { - if (c == '[' || c == ']' || c == '\\') - return c + 32; - else - return ascii_ctype<char_type>::do_tolower(c); - } - }; } /** The ci namespace contains a number of helper classes relevant to case insensitive strings. |