ENH: provide argList::envGlobalPath() static method

- this is identical to either of these solutions:

     * getEnv("FOAM_CASE")
     * stringOps::expand("<case>")

  but with a closer resemblance to argList or Time globalPath(),
  which makes the intent clearer.
  Avoids using raw strings in the caller, which improves compile-time checks.

  Used in situations where a class has no derivation path or other
  access to a time registry or command args.
This commit is contained in:
Mark Olesen
2018-12-15 14:39:12 +01:00
parent 455c8ef540
commit 9076f5b21b
9 changed files with 45 additions and 17 deletions

View File

@ -114,9 +114,17 @@ bool Foam::functionObjects::systemCall::read(const dictionary& dict)
if (executeCalls_.empty() && endCalls_.empty() && writeCalls_.empty())
{
WarningInFunction
<< "no executeCalls, endCalls or writeCalls defined."
<< "No executeCalls, endCalls or writeCalls defined."
<< endl;
}
else if (isAdministrator())
{
FatalErrorInFunction
<< "System calls should not be executed by someone"
<< " with administrator rights for security reasons." << nl
<< nl << endl
<< exit(FatalError);
}
else if (!dynamicCode::allowSystemOperations)
{
FatalErrorInFunction