ENH: Test-dictionary: test dictionary variable expansion

This commit is contained in:
mattijs
2012-10-12 17:52:52 +01:00
parent d6cd28aa3c
commit 78a7cdf7f3

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,7 @@ Description
#include "IOobject.H"
#include "IFstream.H"
#include "dictionary.H"
#include "stringOps.H"
using namespace Foam;
@ -45,6 +46,16 @@ int main(int argc, char *argv[])
argList::validArgs.insert("dict .. dictN");
argList args(argc, argv, false, true);
{
dictionary dict;
dict.add("aaOPENMPIcc", 1);
string s("DDD${aa${WM_MPLIB}cc}EEE");
stringOps::inplaceExpand(s, dict, true, false);
Info<< "variable expansion:" << s << endl;
}
Info<< nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl