]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/hashcomp.h
Convert more by-values to const references, optimise ConfigReader a bit
[user/henk/code/inspircd.git] / include / hashcomp.h
index 32d155e30b9df5b04224190c8bec3fccf70b9a88..7ec813ad6b7db5557ed0e2187ae0df210052d54a 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *                <Craig@chatspike.net>
 
 #include "inspircd_config.h"
 
-/**
+/*******************************************************
  * This file contains classes and templates that deal
  * with the comparison and hashing of 'irc strings'.
  * An 'irc string' is a string which compares in a
  * case insensitive manner, and as per RFC 1459 will
  * treat [ identical to {, ] identical to }, and \
- * as identical to |. Our hashing functions are designed
- * to accept std::string and compare/hash them in an irc
- * type way, irc::string is a seperate class type currently.
- */
+ * as identical to |.
+ *
+ * Our hashing functions are designed  to accept
+ * std::string and compare/hash them as type irc::string
+ * by converting them internally. This makes them
+ * backwards compatible with other code which is not
+ * aware of irc::string.
+ *******************************************************/
 
 #ifdef GCC3
 #include <ext/hash_map>
@@ -125,4 +129,20 @@ namespace irc
        typedef basic_string<char, irc_char_traits, allocator<char> > string;
 }
 
+/* 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);
+bool operator== (irc::string& leftval, std::string& rightval);
+
 #endif