diff options
author | Adam <Adam@anope.org> | 2012-11-22 00:50:33 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-22 00:50:33 -0500 |
commit | d33a0f75a5c0c584fbb7cc0076da36d494f39494 (patch) | |
tree | 7b2274cc833c793c0f5595660cbd4d715de52ffd /include/hashcomp.h | |
parent | 368d469631763e9c8bf399980d0ac7c5b5664d39 (diff) |
Pretty large coding style cleanup, in source doc
cleanup, and allow protocol mods to depend on each
other
Diffstat (limited to 'include/hashcomp.h')
-rw-r--r-- | include/hashcomp.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h index 9f9be9793..74258151a 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -1,13 +1,10 @@ /* + * * Copyright (C) 2002-2011 InspIRCd Development Team * Copyright (C) 2009-2012 Anope Team <team@anope.org> * * Please read COPYING and README for further details. * - * These classes have been copied from InspIRCd and modified - * for use in Anope. - * - * */ #ifndef HASHCOMP_H @@ -28,13 +25,15 @@ namespace Anope { class string; + /* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */ extern std::locale casemap; - template<typename charT> - class ascii_ctype : public std::ctype<charT> + /* ASCII case insensitive ctype. */ + template<typename char_type> + class ascii_ctype : public std::ctype<char_type> { public: - charT do_toupper(charT c) const anope_override + char_type do_toupper(char_type c) const anope_override { if (c >= 'a' && c <= 'z') return c - 32; @@ -42,7 +41,7 @@ namespace Anope return c; } - charT do_tolower(charT c) const anope_override + char_type do_tolower(char_type c) const anope_override { if (c >= 'A' && c <= 'Z') return c + 32; @@ -51,29 +50,30 @@ namespace Anope } }; - template<typename charT> - class rfc1459_ctype : public ascii_ctype<charT> + /* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */ + template<typename char_type> + class rfc1459_ctype : public ascii_ctype<char_type> { public: - charT do_toupper(charT c) const anope_override + char_type do_toupper(char_type c) const anope_override { if (c == '{' || c == '}' || c == '|') return c - 32; else - return ascii_ctype<charT>::do_toupper(c); + return ascii_ctype<char_type>::do_toupper(c); } - charT do_tolower(charT c) const anope_override + char_type do_tolower(char_type c) const anope_override { if (c == '[' || c == ']' || c == '\\') return c + 32; else - return ascii_ctype<charT>::do_tolower(c); + return ascii_ctype<char_type>::do_tolower(c); } }; } -/** The ci namespace contains a number of helper classes. +/** The ci namespace contains a number of helper classes relevant to case insensitive strings. */ namespace ci { |