Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
7c9f49b9
Commit
7c9f49b9
authored
Nov 24, 2008
by
mattijs
Browse files
full match
parent
b352c06f
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/OSspecific/Unix/regularExpression.H
View file @
7c9f49b9
...
...
@@ -37,6 +37,8 @@ SourceFiles
#include
<sys/types.h>
#include
<regex.h>
#include
"string.H"
#include
"IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -73,7 +75,7 @@ public:
{
preg_
=
new
regex_t
;
if
(
regcomp
(
preg_
,
s
.
c_str
(),
REG_EXTENDED
|
REG_NOSUB
)
!=
0
)
if
(
regcomp
(
preg_
,
s
.
c_str
(),
REG_EXTENDED
)
!=
0
)
{
FatalErrorIn
(
...
...
@@ -102,10 +104,12 @@ public:
//- Matches?
inline
bool
matches
(
const
string
&
s
)
const
{
size_t
nmatch
=
0
;
regmatch_t
*
pmatch
=
NULL
;
size_t
nmatch
=
1
;
regmatch_t
pmatch
[
1
]
;
return
regexec
(
preg_
,
s
.
c_str
(),
nmatch
,
pmatch
,
0
)
==
0
;
int
errVal
=
regexec
(
preg_
,
s
.
c_str
(),
nmatch
,
pmatch
,
0
);
return
(
errVal
==
0
&&
pmatch
[
0
].
rm_eo
==
label
(
s
.
size
()));
}
};
...
...
src/OpenFOAM/db/dictionary/dictionary.C
View file @
7c9f49b9
...
...
@@ -27,6 +27,7 @@ License
#include
"dictionary.H"
#include
"primitiveEntry.H"
#include
"dictionaryEntry.H"
#include
"regularExpression.H"
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
...
...
src/OpenFOAM/db/dictionary/dictionary.H
View file @
7c9f49b9
...
...
@@ -60,7 +60,6 @@ SourceFiles
#include
"HashTable.H"
#include
"wordList.H"
#include
"className.H"
#include
"regularExpression.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -68,7 +67,7 @@ namespace Foam
{
// Forward declaration of friend functions and operators
class
regularExpression
;
class
dictionary
;
Istream
&
operator
>>
(
Istream
&
,
dictionary
&
);
Ostream
&
operator
<<
(
Ostream
&
,
const
dictionary
&
);
...
...
src/OpenFOAM/db/dictionary/dictionaryIO.C
View file @
7c9f49b9
...
...
@@ -27,6 +27,7 @@ License
#include
"dictionary.H"
#include
"IFstream.H"
#include
"inputModeEntry.H"
#include
"regularExpression.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment