kinda successful merge, weird tho, didn't go as smoothly with VScode as usual...

This commit is contained in:
Me
2022-08-05 22:25:11 +02:00
23 changed files with 750 additions and 392 deletions

View File

@@ -124,5 +124,18 @@ int path_is_valid(std::string path)
}
void replace_all_substr(std::string &str, const std::string &ori_substr, const std::string &new_substr)
{
if (ori_substr.empty())
return;
size_t pos = 0;
while (1)
{
pos = str.find(ori_substr, pos);
if (pos == std::string::npos)
break;
str.replace(pos, ori_substr.size(), new_substr);
pos += new_substr.size();
}
}