Core: Add initial process support (Process::SpawnDetached)

This commit is contained in:
SirLynix
2024-01-22 23:17:12 +01:00
committed by Jérôme Leclercq
parent 278e59934b
commit ac1422c221
13 changed files with 575 additions and 6 deletions

View File

@@ -77,11 +77,28 @@ namespace Nz
return str;
}
inline std::string& ReplaceStr(std::string& str, std::string_view from, std::string_view to)
template<typename T>
std::basic_string<T>& ReplaceStr(std::basic_string<T>& str, T from, T to)
{
if (str.empty())
return str;
std::size_t startPos = 0;
while ((startPos = str.find(from, startPos)) != std::string::npos)
{
str[startPos] = to;
startPos++;
}
return str;
}
template<typename T>
std::basic_string<T>& ReplaceStr(std::basic_string<T>& str, const T* from, const T* to)
{
return ReplaceStr(str, std::basic_string_view<T>(from), std::basic_string_view<T>(to));
}
template<typename T>
std::basic_string<T>& ReplaceStr(std::basic_string<T>& str, std::basic_string_view<T> from, std::basic_string_view<T> to)
{
std::size_t startPos = 0;
while ((startPos = str.find(from, startPos)) != std::string::npos)
{