Foam::stringListOps Namespace Reference

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...
 

Detailed Description

Various utility functions to work on lists of strings.

Source files

Function Documentation

◆ findMatching()

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)
Returns
List indices for matches

Referenced by ensightMesh::correct(), surfaceFormatsCore::getSelectedPatches(), sampledMeshedSurface::sampledMeshedSurface(), and triSurface::subsetMesh().

Here is the caller graph for this function: