void IISConfigUtil::Replace()

in src/ServiceMonitor/IISConfigUtil.cpp [134:144]


void IISConfigUtil::Replace(std::wstring& str, std::wstring oldValue, std::wstring newValue)
{
    size_t pos = 0;
    size_t oldValueLen = oldValue.length();
    size_t newValueLen = newValue.length();

    while ((pos = str.find(oldValue, pos)) != std::wstring::npos) {
        str.replace(pos, oldValueLen, newValue);
        pos += newValueLen;
    }
}