string: Added const replace and replaceAll
which return the replaced string rather than modify the string the function is called for.
This commit is contained in:
@ -78,6 +78,17 @@ Foam::string& Foam::string::replace
|
||||
}
|
||||
|
||||
|
||||
Foam::string Foam::string::replace
|
||||
(
|
||||
const string& oldStr,
|
||||
const string& newStr,
|
||||
size_type start
|
||||
) const
|
||||
{
|
||||
return string(*this).replace(oldStr, newStr, start);
|
||||
}
|
||||
|
||||
|
||||
Foam::string& Foam::string::replaceAll
|
||||
(
|
||||
const string& oldStr,
|
||||
@ -100,6 +111,17 @@ Foam::string& Foam::string::replaceAll
|
||||
}
|
||||
|
||||
|
||||
Foam::string Foam::string::replaceAll
|
||||
(
|
||||
const string& oldStr,
|
||||
const string& newStr,
|
||||
size_type start
|
||||
) const
|
||||
{
|
||||
return string(*this).replaceAll(oldStr, newStr, start);
|
||||
}
|
||||
|
||||
|
||||
Foam::string& Foam::string::expand(const bool allowEmpty)
|
||||
{
|
||||
stringOps::inplaceExpand(*this, allowEmpty);
|
||||
|
||||
Reference in New Issue
Block a user