#define _HASHCOMP_H_
#include "inspircd_config.h"
+#include "socket.h"
+#include "hash_map.h"
/*******************************************************
* This file contains classes and templates that deal
* backwards compatible with other code which is not
* aware of irc::string.
*******************************************************/
-
-#ifdef GCC3
-#include <ext/hash_map>
-#else
-#include <hash_map>
-#endif
-
-#ifdef GCC3
-#define nspace __gnu_cxx
-#else
-#define nspace std
-#endif
-
+
using namespace std;
namespace nspace
{
-#ifdef GCC34
template<> struct hash<in_addr>
-#else
- template<> struct nspace::hash<in_addr>
-#endif
{
size_t operator()(const struct in_addr &a) const;
};
-#ifdef GCC34
- template<> struct hash<string>
-#else
- template<> struct nspace::hash<string>
-#endif
+
+ template<> struct hash<std::string>
{
size_t operator()(const string &s) const;
};
bool operator()(const in_addr &s1, const in_addr &s2) const;
};
+ class tokenstream
+ {
+ private:
+ std::string tokenbuffer;
+ std::vector<std::string> 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-