From cba65964eb899d523904e5e3c4ad097a387d4bc6 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 12 Aug 2006 01:17:23 +0000 Subject: Document the nspace namespace git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4906 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/hashcomp.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/hashcomp.h b/include/hashcomp.h index 0ca8a6fac..9ead61b6f 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -41,17 +41,35 @@ using irc::sockets::insp_aton; using irc::sockets::insp_ntoa; using irc::sockets::insp_inaddr; +/** Because of weirdness in g++, before 3.x this was namespace std. It's now __gnu_cxx. + * This is a #define'd alias. + */ namespace nspace { + /** Convert a string to lower case respecting RFC1459 + * @param n A string to lowercase + */ void strlower(char *n); + /** Hashing function to hash insp_inaddr structs + */ template<> struct hash { + /** Hash an insp_inaddr + * @param a An insp_inaddr to hash + * @return The hash value + */ size_t operator()(const insp_inaddr &a) const; }; + /** Hashing function to hash std::string without respect to case + */ template<> struct hash { + /** Hash a std::string using RFC1459 case sensitivity rules + * @param s A string to hash + * @return The hash value + */ size_t operator()(const string &s) const; }; } @@ -176,14 +194,12 @@ namespace irc /* Define operators for using >> and << with irc::string to an ostream on an istream. */ /* This was endless fun. No. Really. */ /* It was also the first core change Ommeh made, if anyone cares */ - std::ostream& operator<<(std::ostream &os, const irc::string &str); std::istream& operator>>(std::istream &is, irc::string &str); /* Define operators for + and == with irc::string to std::string for easy assignment * and comparison - Brain */ - std::string operator+ (std::string& leftval, irc::string& rightval); irc::string operator+ (irc::string& leftval, std::string& rightval); bool operator== (std::string& leftval, irc::string& rightval); -- cgit v1.2.3