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 &allow, const wordRes &deny=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 allow,
const wordRes deny = wordRes(),
AccessOp  aop = noOp() 
)

Return ids for items with matching names.

Uses a combination of allow and deny lists

An empty 'allow' list accepts everything not in the 'deny' list. A literal match has higher priority over a regex match.

Eg,

   input:  ( abc apple wall wall1 wall2 )
   allow:  ( abc  def  "wall.*" )
   deny:   ( "[ab].*"  wall )

   result:  (abc wall1 wall2)
Returns
List indices for matches

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

Here is the caller graph for this function: