9 static std::vector<std::string>
Split(std::string s, std::string delimiter)
11 std::vector<std::string> elems;
14 while ((pos = s.find(delimiter)) != std::string::npos)
16 token = s.substr(0, pos);
17 elems.push_back(token);
18 s.erase(0, pos + delimiter.length());
24 static bool Replace(std::string& str,
const std::string& from,
const std::string& to)
26 size_t start_pos = str.find(from);
27 if (start_pos == std::string::npos)
29 str.replace(start_pos, from.length(), to);
37 static float Clamp(
float x,
float min,
float max)
39 return x < min ? min : (x > max ? max : x);
static float Clamp(float x, float min, float max)
static std::vector< std::string > Split(std::string s, std::string delimiter)
static bool Replace(std::string &str, const std::string &from, const std::string &to)