Mock siad changes
This commit is contained in:
@@ -112,7 +112,8 @@ inline Hastings CalculateAverageUploadPrice(const std::vector<IHost>& hosts)
|
||||
return CalculateAveragePrice<IHost, Hastings>(hosts, [](const IHost& host)->Hastings { return host.GetUploadPrice(); });
|
||||
}
|
||||
|
||||
static String& ReplaceStringInPlace(String& subject, const String& search, const String& replace)
|
||||
template<typename T>
|
||||
static T& ReplaceStringInPlace(T& subject, const T& search, const T& replace)
|
||||
{
|
||||
size_t pos = 0;
|
||||
while ((pos = subject.find(search, pos)) != std::string::npos)
|
||||
@@ -124,4 +125,17 @@ static String& ReplaceStringInPlace(String& subject, const String& search, const
|
||||
return subject;
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
static T& ReplaceStringInPlace(T& subject, typename T::value_type* search, const T& replace)
|
||||
{
|
||||
return ReplaceStringInPlace(subject, T(search), replace);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static T& ReplaceStringInPlace(T& subject, typename T::value_type* search, typename T::value_type* replace)
|
||||
{
|
||||
return ReplaceStringInPlace(subject, T(search), T(replace));
|
||||
}
|
||||
|
||||
NS_END(2)
|
Reference in New Issue
Block a user