summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-01 13:44:51 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-11 14:00:42 +0200
commit020f706bcbf616457bf579712a95a1705d392d4b (patch)
treedff17f2ddfbc414a501b8878e8bb383ab78f73df
parent106c0889b392a86bacd1ac0756f0087ce184f685 (diff)
Add ConvToUInt64()
-rw-r--r--include/inspircd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index db13b2ab3..633a0d58d 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -156,6 +156,15 @@ template<typename T> inline long ConvToInt(const T &in)
return atol(tmp.str().c_str());
}
+inline uint64_t ConvToUInt64(const std::string& in)
+{
+ uint64_t ret;
+ std::istringstream tmp(in);
+ if (!(tmp >> ret))
+ return 0;
+ return ret;
+}
+
/** This class contains various STATS counters
* It is used by the InspIRCd class, which internally
* has an instance of it.