Various utility functions to work on lists of strings. More...
Classes | |
struct | foundOp |
Functor to determine if a string is exists in a list of strings. More... | |
Functions | |
template<class StringListType , class AccessOp = noOp> | |
labelList | findMatching (const StringListType &input, const wordRes &whitelist, const wordRes &blacklist=wordRes(), AccessOp aop=noOp()) |
Return ids for items with matching names. More... | |
Various utility functions to work on lists of strings.
labelList Foam::stringListOps::findMatching | ( | const StringListType & | input, |
const wordRes & | whitelist, | ||
const wordRes & | blacklist = wordRes() , |
||
AccessOp | aop = noOp() |
||
) |
Return ids for items with matching names.
Uses a combination of whitelist and blacklist.
An empty whitelist accepts everything that is not blacklisted. A regex match is trumped by a literal match.
Eg,
input: ( abc apple wall wall1 wall2 ) whitelist: ( abc def "wall.*" ) blacklist: ( "[ab].*" wall ) result: (abc wall1 wall2)
Referenced by ensightMesh::correct(), surfaceFormatsCore::getSelectedPatches(), sampledMeshedSurface::sampledMeshedSurface(), and triSurface::subsetMesh().