mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use readOption to fine-tune dictionary reading
- previously had 'mandatory' (bool) for advanced control of reading dictionary entries but its meaning was unclear in the calling code without extra code comments. Now use IOobjectOption::readOption instead, which allows further options (ie, NO_READ) and is more transparent as to its purpose in the code than a true/false bool flag was. This is a minor breaking change (infrequent, advanced usage only) - minor code cleanup in dictionary lookup methods
This commit is contained in:
@ -54,12 +54,16 @@ Foam::Function1<Type>::New
|
||||
<< "For " << entryName << " with dictionary entries: "
|
||||
<< flatOutput(coeffs->toc()) << nl;
|
||||
|
||||
// The "type" entry - mandatory if no redirectType provided
|
||||
coeffs->readEntry
|
||||
(
|
||||
"type",
|
||||
modelType,
|
||||
keyType::LITERAL,
|
||||
modelType.empty() // "type" entry is mandatory if no 'redirect'
|
||||
(
|
||||
modelType.empty()
|
||||
? IOobjectOption::MUST_READ : IOobjectOption::READ_IF_PRESENT
|
||||
)
|
||||
);
|
||||
|
||||
// Fallthrough
|
||||
|
||||
Reference in New Issue
Block a user