Add multiple new feature & update config/readme

累积更新
文档与配置更新
去掉多余的配置项读取
This commit is contained in:
ptmaster
2024-11-24 17:44:03 +01:00
committed by Farewell_
parent fb2c5c117d
commit 3933ecab00
19 changed files with 725 additions and 118 deletions
+36
View File
@@ -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;
}