neutrino: sync keybind and usermenu code with neutrino-mp, code (C) martii

This commit is contained in:
[CST] Focus
2014-09-05 17:49:11 +04:00
parent f07e81c4b9
commit 420af7a4dc
45 changed files with 1767 additions and 1144 deletions

View File

@@ -765,3 +765,56 @@ bool split_config_string(const std::string &str, std::map<std::string,std::strin
}
return !smap.empty();
}
std::vector<std::string> split(const std::string &s, char delim)
{
std::vector<std::string> vec;
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim))
vec.push_back(item);
return vec;
}
std::string to_string(int i)
{
std::stringstream s;
s << i;
return s.str();
}
std::string to_string(unsigned int i)
{
std::stringstream s;
s << i;
return s.str();
}
std::string to_string(long i)
{
std::stringstream s;
s << i;
return s.str();
}
std::string to_string(unsigned long i)
{
std::stringstream s;
s << i;
return s.str();
}
std::string to_string(long long i)
{
std::stringstream s;
s << i;
return s.str();
}
std::string to_string(unsigned long long i)
{
std::stringstream s;
s << i;
return s.str();
}