mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
neutrino: sync keybind and usermenu code with neutrino-mp, code (C) martii
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user