mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -25,6 +25,7 @@ License
|
||||
|
||||
#include "boundaryDataSurfaceWriter.H"
|
||||
#include "makeSurfaceWriterMethods.H"
|
||||
#include "argList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -62,7 +63,7 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::write
|
||||
const pointField& points = surf.points();
|
||||
|
||||
// Dummy time to use as an objectRegistry
|
||||
const fileName caseDir(getEnv("FOAM_CASE"));
|
||||
const fileName caseDir(argList::envGlobalPath());
|
||||
|
||||
Time dummyTime
|
||||
(
|
||||
|
||||
@ -54,7 +54,7 @@ Foam::fileName Foam::boundaryDataSurfaceWriter::writeTemplate
|
||||
const faceList& faces = surf.faces();
|
||||
|
||||
// Dummy time to use as an objectRegistry
|
||||
const fileName caseDir(getEnv("FOAM_CASE"));
|
||||
const fileName caseDir(argList::envGlobalPath());
|
||||
|
||||
Time dummyTime
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user