X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fhashcomp.h;h=ad6a2133e8fdbeafcd3a643205e3b55920fa9b04;hb=6ab0b94dceb7d7f0bfca39976e745f22c7ba8939;hp=7ec813ad6b7db5557ed0e2187ae0df210052d54a;hpb=bb7ff3b7b6defcfb950b25c632d68425afd0492a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/hashcomp.h b/include/hashcomp.h index 7ec813ad6..ad6a2133e 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -18,6 +18,8 @@ #define _HASHCOMP_H_ #include "inspircd_config.h" +#include "socket.h" +#include "hash_map.h" /******************************************************* * This file contains classes and templates that deal @@ -33,36 +35,17 @@ * backwards compatible with other code which is not * aware of irc::string. *******************************************************/ - -#ifdef GCC3 -#include -#else -#include -#endif - -#ifdef GCC3 -#define nspace __gnu_cxx -#else -#define nspace std -#endif - + using namespace std; namespace nspace { -#ifdef GCC34 template<> struct hash -#else - template<> struct nspace::hash -#endif { size_t operator()(const struct in_addr &a) const; }; -#ifdef GCC34 - template<> struct hash -#else - template<> struct nspace::hash -#endif + + template<> struct hash { size_t operator()(const string &s) const; }; @@ -96,6 +79,19 @@ namespace irc bool operator()(const in_addr &s1, const in_addr &s2) const; }; + class tokenstream + { + private: + std::string tokenbuffer; + std::vector tokens; + public: + tokenstream(std::string &source); + ~tokenstream(); + + unsigned int GetNumTokens(); + const std::string& GetToken(unsigned int index); + }; + /** The irc_char_traits class is used for RFC-style comparison of strings. * This class is used to implement irc::string, a case-insensitive, RFC-