Changed: Moved strFindReplaceAll to algo.h

--HG--
branch : develop
This commit is contained in:
kervala 2017-11-05 19:06:03 +01:00
parent 7f1168293a
commit d099e98dae
2 changed files with 9 additions and 3 deletions

View file

@ -211,6 +211,14 @@ bool strFindReplace(T &str, const char *strFind, const U &strReplace)
return strFindReplace(str, tempStr, strReplace);
}
template<class T>
T strFindReplaceAll(const T &str, const T &search, const T &replace)
{
T ret = str;
while (strFindReplace(ret, search, replace));
return ret;
}
// set flags in a bit set
template <class T, class U>
inline void setFlags(T &dest, U mask, bool on)

View file

@ -1817,9 +1817,7 @@ namespace NLGUI
ucstring CLuaIHM::findReplaceAll(const ucstring &str, const ucstring &search, const ucstring &replace)
{
//H_AUTO(Lua_CLuaIHM_findReplaceAll)
ucstring ret= str;
while(strFindReplace(ret, search, replace));
return ret;
return strFindReplaceAll(str, search, replace);
}
// ***************************************************************************