mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add 'report' to trace #includeEntry/#includeIfPresentEntry
- used in "expandDictionary -list" to find which files are included by any particular dictionary
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,6 +39,9 @@ const Foam::word Foam::functionEntries::includeEntry::typeName
|
||||
// might include includeEntry
|
||||
int Foam::functionEntries::includeEntry::debug(0);
|
||||
|
||||
bool Foam::functionEntries::includeEntry::report(false);
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionEntries
|
||||
@ -89,10 +92,15 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
IFstream ifs(includeFileName(is));
|
||||
const fileName fName(includeFileName(is));
|
||||
IFstream ifs(fName);
|
||||
|
||||
if (ifs)
|
||||
{
|
||||
if (Foam::functionEntries::includeEntry::report)
|
||||
{
|
||||
Info<< fName << endl;
|
||||
}
|
||||
parentDict.read(ifs);
|
||||
return true;
|
||||
}
|
||||
@ -119,10 +127,15 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
IFstream ifs(includeFileName(is));
|
||||
const fileName fName(includeFileName(is));
|
||||
IFstream ifs(fName);
|
||||
|
||||
if (ifs)
|
||||
{
|
||||
if (Foam::functionEntries::includeEntry::report)
|
||||
{
|
||||
Info<< fName << endl;
|
||||
}
|
||||
entry.read(parentDict, ifs);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -82,6 +82,12 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
//- Report which file is included to stdout
|
||||
static bool report;
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
ClassName("include");
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -69,10 +69,15 @@ bool Foam::functionEntries::includeIfPresentEntry::execute
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
IFstream ifs(includeFileName(is));
|
||||
const fileName fName(includeFileName(is));
|
||||
IFstream ifs(fName);
|
||||
|
||||
if (ifs)
|
||||
{
|
||||
if (Foam::functionEntries::includeEntry::report)
|
||||
{
|
||||
Info<< fName << endl;
|
||||
}
|
||||
parentDict.read(ifs);
|
||||
}
|
||||
|
||||
@ -87,10 +92,15 @@ bool Foam::functionEntries::includeIfPresentEntry::execute
|
||||
Istream& is
|
||||
)
|
||||
{
|
||||
IFstream ifs(includeFileName(is));
|
||||
const fileName fName(includeFileName(is));
|
||||
IFstream ifs(fName);
|
||||
|
||||
if (ifs)
|
||||
{
|
||||
if (Foam::functionEntries::includeEntry::report)
|
||||
{
|
||||
Info<< fName << endl;
|
||||
}
|
||||
entry.read(parentDict, ifs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user