functionEntry: Simplified the primitiveEntry created when functions are disabled
This commit is contained in:
@ -49,16 +49,14 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::string Foam::functionEntry::readLine(const word& key, Istream& is)
|
||||
Foam::word Foam::functionEntry::readLine(Istream& is)
|
||||
{
|
||||
string s;
|
||||
word s;
|
||||
dynamic_cast<ISstream&>(is).getLine(s);
|
||||
|
||||
return key + s;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionEntry::insert
|
||||
@ -95,8 +93,8 @@ Foam::functionEntry::functionEntry
|
||||
:
|
||||
primitiveEntry
|
||||
(
|
||||
word(key + dict.name() + Foam::name(is.lineNumber())),
|
||||
token(word(readLine(key, is)), is.lineNumber())
|
||||
key,
|
||||
token(readLine(is), is.lineNumber())
|
||||
)
|
||||
{}
|
||||
|
||||
@ -192,6 +190,8 @@ void Foam::functionEntry::write(Ostream& os) const
|
||||
{
|
||||
os.indent();
|
||||
|
||||
writeKeyword(os, keyword());
|
||||
|
||||
for (label i=0; i<size(); ++i)
|
||||
{
|
||||
os << operator[](i);
|
||||
|
||||
@ -67,8 +67,9 @@ class functionEntry
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Read line as string token
|
||||
static string readLine(const word& key, Istream& is);
|
||||
//- Read line as word token
|
||||
static word readLine(Istream& is);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@ -373,7 +373,6 @@ bool Foam::functionObjectList::readFunctionObject
|
||||
funcDict.set("region", region);
|
||||
}
|
||||
|
||||
// Merge this functionObject dictionary into functionsDict
|
||||
const word funcCallKeyword = string::validate<word>(funcCall);
|
||||
dictionary funcArgsDict;
|
||||
funcArgsDict.add(funcCallKeyword, funcDict);
|
||||
@ -400,6 +399,7 @@ bool Foam::functionObjectList::readFunctionObject
|
||||
requiredFields.insert(wordList(expandedFuncDict.lookup("fields")));
|
||||
}
|
||||
|
||||
// Merge this functionObject dictionary into functionsDict
|
||||
functionsDict.merge(funcArgsDict);
|
||||
functionsDict.subDict(funcCallKeyword).name() = funcDict.name();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user