diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | include/hashcomp.h | 48 |
2 files changed, 3 insertions, 49 deletions
diff --git a/include/config.h b/include/config.h index fe4a6fded..fdeddf6dc 100644 --- a/include/config.h +++ b/include/config.h @@ -60,9 +60,10 @@ namespace Configuration const item_map* GetItems() const; }; - template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const; + template<> CoreExport Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const; template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const; template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const; + template<> CoreExport unsigned int Block::Get(const Anope::string &tag, const Anope::string &def) const; /** Represents a configuration file */ @@ -122,6 +123,7 @@ namespace Configuration std::vector<Anope::string> ModulesAutoLoad; /* After how many characters do we wrap lines? */ unsigned int LineWrap; + unsigned char CaseMapUpper[256], CaseMapLower[256]; /* module configuration blocks */ std::map<Anope::string, Block *> modules; 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. |