Update Utils.cpp
This commit is contained in:
parent
520f115aa2
commit
a8c76dbcbc
@ -56,6 +56,11 @@ bool ToBool(const std::string& s)
|
||||
return !!Compare(s, "false", false);
|
||||
}
|
||||
|
||||
int ToInt(const std::string& s) // handy function
|
||||
{
|
||||
return stoi(s); // real simple. :)
|
||||
}
|
||||
|
||||
bool IpToByte(const char* ip, char bytes[4])
|
||||
{
|
||||
return (sscanf(ip, "%hhu.%hhu.%hhu.%hhu", &bytes[0], &bytes[1], &bytes[2], &bytes[3]) == 4);
|
||||
@ -157,4 +162,4 @@ std::string ToNarrow(const std::wstring& wide)
|
||||
std::wstring ToWide(const std::string& narrow)
|
||||
{
|
||||
return m_converter.from_bytes(narrow);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user