ENH: allow modifiable access to IOobject local(), as per instance()

ENH: simplify code by using fieldTypes::is_xxx() tests
This commit is contained in:
Mark Olesen
2025-08-12 12:34:39 +02:00
parent 891ac808de
commit 1642841868
26 changed files with 95 additions and 128 deletions

View File

@ -42,7 +42,7 @@ using namespace Foam;
int main(int argc, char *argv[])
{
stringList strings
{
({
"hello",
"heello",
"heeello",
@ -52,7 +52,7 @@ int main(int argc, char *argv[])
"okey",
"okkey",
"okkkey",
};
});
labelList matches;
wordRes matcher1(ICharStream("( okey \"[hy]e+.*\" )")());
@ -72,12 +72,14 @@ int main(int argc, char *argv[])
}
}
Info<< "Match found using ListOps = "
<< ListOps::found(strings, regExp(".*ee.*")) << nl;
Info<< "First index = "
<< ListOps::find(strings, regExp(".*ee.*")) << nl;
{
regExp matcher(".*ee.*");
Info<< "Match found using ListOps = "
<< ListOps::found_if(strings, matcher) << nl
<< "First index = "
<< ListOps::find_if(strings, matcher) << nl;
}
Info<< endl;
matches = findMatchingStrings(matcher1, strings);