ENH: string : recursive variable substitution

This commit is contained in:
mattijs
2010-12-19 18:30:52 +00:00
parent fb92bdb5fe
commit 283f4fab77
2 changed files with 6 additions and 2 deletions

View File

@ -94,7 +94,7 @@ Foam::string& Foam::string::replaceAll
// Expand all occurences of environment variables and initial tilde sequences // Expand all occurences of environment variables and initial tilde sequences
Foam::string& Foam::string::expand() Foam::string& Foam::string::expand(const bool recurse)
{ {
size_type startEnvar = 0; size_type startEnvar = 0;
@ -140,6 +140,10 @@ Foam::string& Foam::string::expand()
if (enVarString.size()) if (enVarString.size())
{ {
if (recurse)
{
enVarString.expand();
}
std::string::replace std::string::replace
( (
startEnvar, startEnvar,

View File

@ -182,7 +182,7 @@ public:
// //
// @sa // @sa
// Foam::findEtcFile // Foam::findEtcFile
string& expand(); string& expand(const bool recurse=false);
//- Remove repeated characters returning true if string changed //- Remove repeated characters returning true if string changed
bool removeRepeated(const char); bool removeRepeated(const char);