mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Add ConvToInt() template to go with ConvToStr() that we've had for a while
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6064 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
b3a11cb400
commit
79939d71ba
@ -71,6 +71,13 @@ template<typename T> inline std::string ConvToStr(const T &in)
|
||||
return tmp.str();
|
||||
}
|
||||
|
||||
template<typename T> inline long ConvToInt(const T &in)
|
||||
{
|
||||
std::stringstream tmp;
|
||||
if (!(tmp << in)) return 0;
|
||||
return atoi(tmp.str().c_str());
|
||||
}
|
||||
|
||||
/** This class contains various STATS counters
|
||||
* It is used by the InspIRCd class, which internally
|
||||
* has an instance of it.
|
||||
|
Loading…
x
Reference in New Issue
Block a user