ENH: include file tracking: missed out adding files to list of files to check

This commit is contained in:
mattijs
2016-01-27 17:35:46 +00:00
parent d7ac243dfc
commit 70525fe75e
4 changed files with 119 additions and 10 deletions

View File

@ -24,10 +24,10 @@ License
\*---------------------------------------------------------------------------*/
#include "includeEntry.H"
#include "dictionary.H"
#include "IFstream.H"
#include "addToMemberFunctionSelectionTable.H"
#include "stringOps.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -127,6 +127,9 @@ bool Foam::functionEntries::includeEntry::execute
(
includeFileName(is.name().path(), rawFName, parentDict)
);
// Read contents of file into parentDict
IFstream ifs(fName);
if (ifs)
@ -135,6 +138,21 @@ bool Foam::functionEntries::includeEntry::execute
{
Info<< fName << endl;
}
// Add watch on included file
const dictionary& top = parentDict.topDict();
if (isA<regIOobject>(top))
{
regIOobject& rio = const_cast<regIOobject&>
(
dynamic_cast<const regIOobject&>(top)
);
//Info<< rio.name() << " : adding depenency on included file "
// << fName << endl;
rio.addWatch(fName);
}
parentDict.read(ifs);
return true;
}
@ -165,6 +183,9 @@ bool Foam::functionEntries::includeEntry::execute
(
includeFileName(is.name().path(), rawFName, parentDict)
);
// Read contents of file into parentDict
IFstream ifs(fName);
if (ifs)
@ -173,6 +194,21 @@ bool Foam::functionEntries::includeEntry::execute
{
Info<< fName << endl;
}
// Add watch on included file
const dictionary& top = parentDict.topDict();
if (isA<regIOobject>(top))
{
regIOobject& rio = const_cast<regIOobject&>
(
dynamic_cast<const regIOobject&>(top)
);
//Info<< rio.name() << " : adding depenency on included file "
// << fName << endl;
rio.addWatch(fName);
}
entry.read(parentDict, ifs);
return true;
}