mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add dictionary::findStream() - symmetric with findDict()
- can be used with this type of code:
ITstream* streamPtr = dict.findStream(name);
if (streamPtr)
{
auto& is = *streamPtr;
...
}
versus:
const entry* eptr = dict.findEntry(name);
if (eptr && eptr->isStream())
{
auto& is = eptr->stream();
...
}
ENH: add findStream(), streamPtr(), isStream() to dictionary search
- symmetric with findDict(), dictPtr(), isDict() methods
STYLE: use findDict() instead of found() + subDict() pairing
COMP: define is_globalIOobject trait at top of IOobject header
- more visibility, permits reuse for specializations etc.
This commit is contained in:
@ -549,16 +549,17 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< finder.dict();
|
||||
}
|
||||
else if (finder.ref().isStream())
|
||||
else if (finder.isStream())
|
||||
{
|
||||
bool addSep = false;
|
||||
bool separator = false;
|
||||
|
||||
const tokenList& tokens = finder.ref().stream();
|
||||
|
||||
for (const token& tok : tokens)
|
||||
for (const token& tok : finder.stream())
|
||||
{
|
||||
if (addSep) Info<< token::SPACE;
|
||||
addSep = true;
|
||||
if (separator)
|
||||
{
|
||||
Info<< token::SPACE;
|
||||
}
|
||||
separator = true;
|
||||
Info<< tok;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
Reference in New Issue
Block a user