All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
wordReListMatcher.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::wordReListMatcher
26 
27 Description
28  A wrapper for matching a List of wordRe.
29 
30  Note:
31  The constructor should remain non-explicit. This allows automatic
32  conversion from UList<wordRe> to wordReListMatcher in search
33  functions.
34 
35 SourceFiles
36  wordReListMatcherI.H
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef wordReListMatcher_H
41 #define wordReListMatcher_H
42 
43 #include "wordReList.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class wordReListMatcher Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56  // Private Data
57 
58  //- Reference to underlying list
59  const UList<wordRe>& reList_;
60 
61 public:
62 
63  // Constructors
64 
65  //- Construct from a List of wordRe
66  inline wordReListMatcher(const UList<wordRe>&);
67 
68 
69  // Member Functions
70 
71  // Access
72 
73  inline label size() const;
74 
75  inline bool empty() const;
76 
77  //- Return underlying list of wordRe
78  inline const UList<wordRe>& operator()() const;
79 
80 
81  // Searching
82 
83  //- Return true if string matches any of the regular expressions
84  // Smart match as regular expression or as a string.
85  // Optionally specify a literal match only.
86  inline bool match(const string&, bool literalMatch=false) const;
87 };
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 } // End namespace Foam
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 #include "wordReListMatcherI.H"
97 
98 #endif
99 
100 // ************************************************************************* //
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
A wrapper for matching a List of wordRe.
wordReListMatcher(const UList< wordRe > &)
Construct from a List of wordRe.
const UList< wordRe > & operator()() const
Return underlying list of wordRe.
bool match(const string &, bool literalMatch=false) const
Return true if string matches any of the regular expressions.
Namespace for OpenFOAM.