Various utility functions to work on lists of strings. More...
Classes | |
| struct | foundOp |
| Functor to determine if a string exists in a list of strings. More... | |
Functions | |
| template<class StringListType, class AccessOp = identityOp> | |
| labelList | findMatching (const StringListType &input, const wordRes::filter &pred, AccessOp aop=identityOp()) |
| Return ids for items with matching names. | |
| template<class StringListType, class AccessOp = identityOp> | |
| labelList | findMatching (const StringListType &input, const wordRes &allow, const wordRes &deny=wordRes::null(), AccessOp aop=identityOp()) |
| Return ids for items with matching names, using a combination of allow and deny lists as per wordRes::filter. | |
Various utility functions to work on lists of strings.
| labelList findMatching | ( | const StringListType & | input, |
| const wordRes::filter & | pred, | ||
| AccessOp | aop = identityOp() ) |
Return ids for items with matching names.
The filter predicate is a combination of allow and deny lists
Referenced by surfaceFormatsCore::getSelectedPatches(), and triSurface::subsetMesh().

| labelList findMatching | ( | const StringListType & | input, |
| const wordRes & | allow, | ||
| const wordRes & | deny = wordRes::null(), | ||
| AccessOp | aop = identityOp() ) |
Return ids for items with matching names, using a combination of allow and deny lists as per wordRes::filter.
An empty allow accepts everything not in deny. A literal allow match has higher priority than any deny. A regex allow match has lower priority than any deny.
Example (when applied to a list of words),
* input: ( abc apple test other val val1 val2 wall wall1 wall2 ) * allow: ( abc def "t.*" other val val1 "wall.*" ) * deny: ( "[ab].*" "t.*" other "val[0-9]" wall ) * * result: (abc other val val1 wall1 wall2) *
References wordRes::null().
