wordRes Class Reference

A List of wordRe with additional matching capabilities. More...

Inheritance diagram for wordRes:
[legend]
Collaboration diagram for wordRes:
[legend]

Classes

struct  matcher
 Functor wrapper for matching against a List of wordRe. More...
 

Public Member Functions

 ~wordRes ()=default
 Destructor. More...
 
void uniq ()
 Filter out duplicate entries (inplace). More...
 
bool match (const std::string &text, bool literal=false) const
 Smart match as literal or regex, stopping on the first match. More...
 
wordRe::compOption matched (const std::string &text) const
 Smart match in the list of matchers, returning the match type. More...
 
template<class StringType >
labelList matching (const UList< StringType > &input, const bool invert=false) const
 Return list indices for all matches. More...
 
bool operator() (const std::string &text) const
 Identical to match(), for use as a predicate. More...
 
template<class StringType >
Foam::labelList matching (const UList< StringType > &input, const bool invert) const
 
- Public Member Functions inherited from List< wordRe >
constexpr List () noexcept
 Default construct. More...
 
 List (const label len)
 Construct with given size. More...
 
 List (const label len, const wordRe &val)
 Construct with given size and value for all elements. More...
 
 List (const label len, const Foam::zero)
 Construct with given size initializing all elements to zero. More...
 
 List (const Foam::one, const wordRe &val)
 Construct with length=1, copying the value as the only content. More...
 
 List (const Foam::one, wordRe &&val)
 Construct with length=1, moving the value as the only content. More...
 
 List (const Foam::one, const Foam::zero)
 Construct with length=1, initializing content to zero. More...
 
 List (const List< wordRe > &a)
 Copy construct from list. More...
 
 List (const UList< wordRe > &a)
 Copy construct contents from list. More...
 
 List (List< wordRe > &a, bool reuse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< wordRe > &list, const labelUList &indices)
 Copy construct subset of list. More...
 
 List (const UList< wordRe > &list, const FixedList< label, N > &indices)
 Copy construct subset of list. More...
 
 List (const FixedList< wordRe, N > &list)
 Construct as copy of FixedList<T, N> More...
 
 List (const PtrList< wordRe > &list)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< wordRe > &list)
 Construct as copy of SLList<T> More...
 
 List (const IndirectListBase< wordRe, Addr > &list)
 Construct as copy of IndirectList contents. More...
 
 List (std::initializer_list< wordRe > list)
 Construct from an initializer list. More...
 
 List (List< wordRe > &&list)
 Move construct from List. More...
 
 List (DynamicList< wordRe, SizeMin > &&list)
 Move construct from DynamicList. More...
 
 List (SortableList< wordRe > &&list)
 Move construct from SortableList. More...
 
 List (SLList< wordRe > &&list)
 Move construct from SLList. More...
 
 List (Istream &is)
 Construct from Istream. More...
 
autoPtr< List< wordRe > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void resize (const label len)
 Adjust allocated size of list. More...
 
void resize (const label len, const wordRe &val)
 Adjust allocated size of list and set val for new elements. More...
 
void resize (const label newLen)
 
void resize_nocopy (const label len)
 Adjust allocated size of list without necessarily. More...
 
void setSize (const label n)
 Alias for resize() More...
 
void setSize (const label n, const wordRe &val)
 Alias for resize() More...
 
void append (const wordRe &val)
 Append an element at the end of the list. More...
 
void append (wordRe &&val)
 Move append an element at the end of the list. More...
 
void append (const UList< wordRe > &list)
 Append a List to the end of this list. More...
 
void append (const IndirectListBase< wordRe, Addr > &list)
 Append IndirectList contents at the end of this list. More...
 
label appendUniq (const wordRe &val)
 Append an element if not already in the list. More...
 
void transfer (List< wordRe > &list)
 
void transfer (DynamicList< wordRe, SizeMin > &list)
 
void transfer (SortableList< wordRe > &list)
 
wordRenewElmt (const label i)
 
void operator= (const UList< wordRe > &a)
 Assignment to UList operator. Takes linear time. More...
 
void operator= (const List< wordRe > &list)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< wordRe > &list)
 Assignment to SLList operator. Takes linear time. More...
 
void operator= (const IndirectListBase< wordRe, Addr > &list)
 Assignment from IndirectList. Takes linear time. More...
 
void operator= (const FixedList< wordRe, N > &list)
 Copy assignment from FixedList. More...
 
void operator= (std::initializer_list< wordRe > list)
 Assignment to an initializer list. More...
 
void operator= (const wordRe &val)
 Assignment of all entries to the given value. More...
 
void operator= (const Foam::zero)
 Assignment of all entries to zero. More...
 
void operator= (List< wordRe > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (DynamicList< wordRe, SizeMin > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (SortableList< wordRe > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (SLList< wordRe > &&list)
 Move assignment. Takes constant time. More...
 
IstreamreadList (Istream &is)
 Read List from Istream, discarding contents of existing List. More...
 
IstreamreadList (Istream &is)
 
IstreamreadList (Istream &is)
 
void shallowCopy (const UList< wordRe > &)=delete
 No shallowCopy permitted. More...
 
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set (const label i, bool val=true)
 A bitSet::set() method for a list of bool. More...
 

Static Public Member Functions

static const wordResnull ()
 Return a null wordRes - a reference to the NullObject. More...
 
static wordRes uniq (const UList< wordRe > &input)
 Return a wordRes with duplicate entries filtered out. More...
 
- Static Public Member Functions inherited from List< wordRe >
static const List< wordRe > & null ()
 Return a null List. More...
 

Additional Inherited Members

- Public Types inherited from List< wordRe >
typedef SubList< wordResubList
 Declare type of subList. More...
 

Detailed Description

A List of wordRe with additional matching capabilities.

Source files

Definition at line 51 of file wordRes.H.

Constructor & Destructor Documentation

◆ ~wordRes()

~wordRes ( )
default

Destructor.

Member Function Documentation

◆ null()

const Foam::wordRes & null ( )
inlinestatic

Return a null wordRes - a reference to the NullObject.

Definition at line 30 of file wordResI.H.

◆ uniq() [1/2]

Foam::wordRes uniq ( const UList< wordRe > &  input)
static

Return a wordRes with duplicate entries filtered out.

No distinction made between literals and regular expressions.

Definition at line 32 of file wordRes.C.

References Foam::BitOps::count(), forAll, Foam::input(), and Foam::output().

Referenced by ensightWrite::read(), and sampledMeshedSurface::sampledMeshedSurface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uniq() [2/2]

void uniq ( )

Filter out duplicate entries (inplace).

No distinction made between literals and regular expressions.

Definition at line 70 of file wordRes.C.

References Foam::BitOps::count(), forAll, Foam::input(), and Foam::output().

Here is the call graph for this function:

◆ match()

bool match ( const std::string &  text,
bool  literal = false 
) const
inline

Smart match as literal or regex, stopping on the first match.

Parameters
literalForce literal match only.
Returns
True if text matches ANY of the entries.

Definition at line 91 of file wordResI.H.

Referenced by cellTable::combine(), dictionaryContent::copyDict(), namesList< solutionEntry >::findNames(), ZoneMesh< cellZone, polyMesh >::indices(), polyBoundaryMesh::indices(), boundaryRegion::names(), cellTable::names(), polyBoundaryMesh::patchSet(), multiRegion::read(), Cloud< passivePositionParticle >::readFromFiles(), and particle< Type >::writeProperty().

Here is the caller graph for this function:

◆ matched()

Foam::wordRe::compOption matched ( const std::string &  text) const
inline

Smart match in the list of matchers, returning the match type.

It stops if there is a literal match, or continues to examine other regexs.

Returns
LITERAL if a lteral match was found, REGEX if any regex match was found, UNKNOWN otherwise.

Definition at line 98 of file wordResI.H.

Referenced by dictionaryContent::copyDict().

Here is the caller graph for this function:

◆ matching() [1/2]

labelList matching ( const UList< StringType > &  input,
const bool  invert = false 
) const
inline

Return list indices for all matches.

Parameters
inputA list of string inputs to match against
invertinvert the matching logic
Returns
indices of the matches in the input list

Referenced by ensightMesh::correct(), PatchParticleHistogram< CloudType >::PatchParticleHistogram(), and PatchPostProcessing< CloudType >::PatchPostProcessing().

Here is the caller graph for this function:

◆ operator()()

bool operator() ( const std::string &  text) const
inline

Identical to match(), for use as a predicate.

Definition at line 132 of file wordResI.H.

◆ matching() [2/2]

Foam::labelList matching ( const UList< StringType > &  input,
const bool  invert 
) const
inline

Definition at line 106 of file wordResI.H.

References Foam::BitOps::count(), Foam::input(), Foam::invert(), Foam::stringOps::match(), and List< T >::resize().

Here is the call graph for this function:

The documentation for this class was generated from the following files: