mirror of
https://github.com/esuo1198/TaikoArcadeLoader.git
synced 2026-10-07 14:18:04 +03:00
Add multiple new feature & update config/readme
累积更新 文档与配置更新 去掉多余的配置项读取
This commit is contained in:
@@ -108,4 +108,40 @@ printColour (int colour, const char *format, ...) {
|
||||
SetConsoleTextAttribute (consoleHandle, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
|
||||
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
std::wstring
|
||||
replace (const std::wstring orignStr, const std::wstring oldStr, const std::wstring newStr) {
|
||||
size_t pos = 0;
|
||||
std::wstring tempStr = orignStr;
|
||||
std::wstring::size_type newStrLen = newStr.length();
|
||||
std::wstring::size_type oldStrLen = oldStr.length();
|
||||
while(true)
|
||||
{
|
||||
pos = tempStr.find(oldStr, pos);
|
||||
if (pos == std::wstring::npos) break;
|
||||
|
||||
tempStr.replace(pos, oldStrLen, newStr);
|
||||
pos += newStrLen;
|
||||
}
|
||||
|
||||
return tempStr;
|
||||
}
|
||||
|
||||
std::string
|
||||
replace (const std::string orignStr, const std::string oldStr, const std::string newStr) {
|
||||
size_t pos = 0;
|
||||
std::string tempStr = orignStr;
|
||||
std::string::size_type newStrLen = newStr.length();
|
||||
std::string::size_type oldStrLen = oldStr.length();
|
||||
while(true)
|
||||
{
|
||||
pos = tempStr.find(oldStr, pos);
|
||||
if (pos == std::string::npos) break;
|
||||
|
||||
tempStr.replace(pos, oldStrLen, newStr);
|
||||
pos += newStrLen;
|
||||
}
|
||||
|
||||
return tempStr;
|
||||
}
|
||||
Reference in New Issue
Block a user