summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/hashcomp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 453e28c45..58b6c05ed 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -31,6 +31,7 @@
#include <map>
#include <set>
#include "inspircd.h"
+#include "convto.h"
/*******************************************************
* This file contains classes and templates that deal
@@ -139,6 +140,21 @@ namespace irc
*/
bool GetToken(std::string& token);
+ /** Fetch the next numeric token from the stream
+ * @param token The next token from the stream is placed here
+ * @return True if tokens still remain, false if there are none left
+ */
+ template<typename Numeric>
+ bool GetNumericToken(Numeric& token)
+ {
+ std::string str;
+ if (!GetToken(str))
+ return false;
+
+ token = ConvToNum<Numeric>(str);
+ return true;
+ }
+
/** Fetch the entire remaining stream, without tokenizing
* @return The remaining part of the stream
*/