diff --git a/applications/test/DirLister/DirLister.H b/applications/test/DirLister/DirLister.H index e1108e7122..497b15c07e 100644 --- a/applications/test/DirLister/DirLister.H +++ b/applications/test/DirLister/DirLister.H @@ -55,7 +55,7 @@ Description items: \code { - wordReList matchProcs + wordRes matchProcs { wordRe("processors"), wordRe("processor\\d+", wordRe::REGEX) @@ -64,7 +64,7 @@ Description for ( const word& item - : DirLister::dirs(".").where(wordRes(matchProcs)) + : DirLister::dirs(".").where(matchProcs) ) { Info<< "processor dir: " << item << nl; @@ -75,7 +75,7 @@ Description methods: \code { - wordReList matchProcs + wordRes matchProcs { wordRe("processor[0-9][0-9]*", wordRe::REGEX), wordRe("processors") @@ -83,7 +83,7 @@ Description fileNameList procDirs ( - DirLister::dirs(".").sorted(wordRes(matchProcs)) + DirLister::dirs(".").sorted(matchProcs) ); } \endcode diff --git a/applications/test/DirLister/Test-DirLister.C b/applications/test/DirLister/Test-DirLister.C index b528a1558a..50803da990 100644 --- a/applications/test/DirLister/Test-DirLister.C +++ b/applications/test/DirLister/Test-DirLister.C @@ -144,16 +144,15 @@ int main(int argc, char *argv[]) << "List files - filtered" << nl << "~~~~~~~~~~" << nl; - wordReList relist - { + wordRes relist + ({ wordRe("processors"), wordRe("processor[0-9][0-9]*", wordRe::REGEX) - }; - wordRes matcher(relist); + }); - Info<<"matcher: " << flatOutput(matcher) << endl; + Info<<"matcher: " << flatOutput(relist) << endl; - for (const word& item : DirLister::dirs(".").where(wordRes(relist))) + for (const word& item : DirLister::dirs(".").where(relist)) { Info<< "=> " << item << nl; } @@ -161,7 +160,7 @@ int main(int argc, char *argv[]) Info<< "dirList: " << flatOutput ( - DirLister::dirs(".").sorted(wordRes(relist)) + DirLister::dirs(".").sorted(relist) ) << nl; } diff --git a/applications/test/IOobjectList/Test-IOobjectList.C b/applications/test/IOobjectList/Test-IOobjectList.C index 21ab2fafaf..40b1f42e7e 100644 --- a/applications/test/IOobjectList/Test-IOobjectList.C +++ b/applications/test/IOobjectList/Test-IOobjectList.C @@ -40,7 +40,7 @@ using namespace Foam; int main(int argc, char *argv[]) { argList::noParallel(); - argList::addOption("re", "wordReList"); + argList::addOption("re", "wordRes"); // timeSelector::addOptions(); timeSelector::addOptions(true, true); @@ -48,12 +48,10 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - wordReList matcher; - if (args.found("re")) + wordRes matcher; + if (args.readListIfPresent("re", matcher)) { - matcher = args.readList("re"); Info<<"limit names: " << matcher << nl; - } const hashedWordList subsetTypes diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index 945b0e9998..1628b6f9ed 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -34,7 +34,7 @@ See also #include "OSspecific.H" #include "argList.H" -#include "wordReList.H" +#include "wordRes.H" #include "IOstreams.H" #include "StringStream.H" @@ -446,20 +446,11 @@ int main(int argc, char *argv[]) Info<<"read float " << xxx << endl; } - if (args.found("reList")) - { - reLst = args.readList("reList"); - } + args.readListIfPresent("reList", reLst); + args.readListIfPresent("wordList", wLst); - if (args.found("wordList")) + if (args.readListIfPresent("stringList", sLst)) { - wLst = args.readList("wordList"); - } - - if (args.found("stringList")) - { - sLst = args.readList("stringList"); - printMyString(sLst); } diff --git a/applications/test/PointEdgeWave/Test-PointEdgeWave.C b/applications/test/PointEdgeWave/Test-PointEdgeWave.C index 8735043f78..ea2419c772 100644 --- a/applications/test/PointEdgeWave/Test-PointEdgeWave.C +++ b/applications/test/PointEdgeWave/Test-PointEdgeWave.C @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) labelList patchIDs ( - pbm.patchSet(wordReList(IStringStream(args[1])())).sortedToc() + pbm.patchSet(args.readList(1)).sortedToc() ); Info<< "Starting walk from patches " diff --git a/applications/test/stringList/Test-stringList.C b/applications/test/stringList/Test-stringList.C index f4ea77f062..60db8cfc7c 100644 --- a/applications/test/stringList/Test-stringList.C +++ b/applications/test/stringList/Test-stringList.C @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) "okkkey", }; - wordReList reLst(IStringStream("( okey \"[hy]e+.*\" )")()); + wordRes reLst(IStringStream("( okey \"[hy]e+.*\" )")()); Info<< "stringList " << strLst << nl; diff --git a/applications/test/wordRe/Test-wordRe.C b/applications/test/wordRe/Test-wordRe.C index 5504e66a1e..80247a11e0 100644 --- a/applications/test/wordRe/Test-wordRe.C +++ b/applications/test/wordRe/Test-wordRe.C @@ -31,7 +31,6 @@ Description #include "List.H" #include "Tuple2.H" #include "keyType.H" -#include "wordRe.H" #include "wordRes.H" #include "predicates.H" @@ -108,7 +107,7 @@ int main(int argc, char *argv[]) wordRes wrelist(wordrelist); - Info<< "re-list:" << wrelist() << endl; + Info<< "re-list:" << wrelist << endl; Info<< "match this: " << wrelist("this") << endl; Info<< "match xyz: " << wrelist("xyz") << endl; Info<< "match zyx: " << wrelist("zyx") << endl; diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C index 7e3940ee00..aac1d730d5 100644 --- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C +++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C @@ -81,12 +81,11 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); // Find set of patches from the list of regular expressions provided - const wordReList patches((IStringStream(args[1])())); - const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches)); - + const wordRes patches(args.readList(1)); const scalar weight = args.read(2); const bool overwrite = args.found("overwrite"); + const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches)); if (!patchSet.size()) { FatalErrorInFunction diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index d3d4942766..44b1266aa5 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -1666,7 +1666,7 @@ int main(int argc, char *argv[]) { includePatches = bMesh.patchSet ( - wordReList(args.lookup("patches")()) + args.readList("patches") ); } else diff --git a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C index 572c039994..94e59afbc6 100644 --- a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C +++ b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C @@ -414,7 +414,7 @@ int main(int argc, char *argv[]) } else if (args.found("patches")) { - const wordReList patchNames(args.opt("patches")); + const wordRes patchNames(args.readList("patches")); exposedPatchIDs = mesh.boundaryMesh().patchSet(patchNames).sortedToc(); diff --git a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C index cc25e76b55..06abc23d3a 100644 --- a/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C +++ b/applications/utilities/mesh/manipulation/transformPoints/transformPoints.C @@ -360,10 +360,10 @@ int main(int argc, char *argv[]) } } - if (args.found("scale")) + List scaling; + if (args.readListIfPresent("scale", scaling)) { - // Use readList to handle single or multiple values - const List scaling = args.readList("scale"); + // readList handles single or multiple values if (scaling.size() == 1) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index ed29448739..6633b330b6 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -127,20 +127,20 @@ int main(int argc, char *argv[]) argList::addOption ( "patches", - "wordReList", + "wordRes", "specify particular patches to write - eg '(outlet \"inlet.*\")'. " "An empty list suppresses writing the internalMesh." ); argList::addOption ( "faceZones", - "wordReList", + "wordRes", "specify faceZones to write - eg '( slice \"mfp-.*\" )'." ); argList::addOption ( "fields", - "wordReList", + "wordRes", "specify fields to export (all by default) - eg '( \"U.*\" )'." ); argList::addOption @@ -249,11 +249,8 @@ int main(int argc, char *argv[]) // const bool noLagrangian = args.found("noLagrangian"); - wordReList fieldPatterns; - if (args.found("fields")) - { - fieldPatterns = args.readList("fields"); - } + wordRes fieldPatterns; + args.readListIfPresent("fields", fieldPatterns); word cellZoneName; if (args.readIfPresent("cellZone", cellZoneName)) diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C index f8f463b626..9bd600c2bb 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C @@ -79,8 +79,7 @@ Usage #include "tensorIOField.H" #include "passiveParticleCloud.H" #include "faceSet.H" -#include "stringOps.H" -#include "wordReList.H" +#include "wordRes.H" #include "meshSubsetHelper.H" #include "readFields.H" @@ -117,7 +116,7 @@ void print(Ostream& os, const wordList& flds) labelList getSelectedPatches ( const polyBoundaryMesh& patches, - const List& excludePatches //HashSet& excludePatches + const wordRes& excludePatches ) { DynamicList