Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
cc571ba1
Commit
cc571ba1
authored
Dec 12, 2008
by
Mark Olesen
Browse files
removed last bits of wildcard vs. pattern
parent
df1573aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/dictionary/dictionary.C
View file @
cc571ba1
...
...
@@ -46,9 +46,9 @@ bool Foam::dictionary::findInPatterns
DLList
<
autoPtr
<
regExp
>
>::
const_iterator
&
reLink
)
const
{
if
(
wildCard
Entries_
.
size
()
>
0
)
if
(
pattern
Entries_
.
size
()
>
0
)
{
while
(
wcLink
!=
wildCard
Entries_
.
end
())
while
(
wcLink
!=
pattern
Entries_
.
end
())
{
if
(
...
...
@@ -76,9 +76,9 @@ bool Foam::dictionary::findInPatterns
DLList
<
autoPtr
<
regExp
>
>::
iterator
&
reLink
)
{
if
(
wildCard
Entries_
.
size
()
>
0
)
if
(
pattern
Entries_
.
size
()
>
0
)
{
while
(
wcLink
!=
wildCard
Entries_
.
end
())
while
(
wcLink
!=
pattern
Entries_
.
end
())
{
if
(
...
...
@@ -127,8 +127,8 @@ Foam::dictionary::dictionary
if
(
iter
().
keyword
().
isPattern
())
{
wildCard
Entries_
.
insert
(
&
iter
());
wildCard
Regexps_
.
insert
pattern
Entries_
.
insert
(
&
iter
());
pattern
Regexps_
.
insert
(
autoPtr
<
regExp
>
(
new
regExp
(
iter
().
keyword
()))
);
...
...
@@ -157,8 +157,8 @@ Foam::dictionary::dictionary
if
(
iter
().
keyword
().
isPattern
())
{
wildCard
Entries_
.
insert
(
&
iter
());
wildCard
Regexps_
.
insert
pattern
Entries_
.
insert
(
&
iter
());
pattern
Regexps_
.
insert
(
autoPtr
<
regExp
>
(
new
regExp
(
iter
().
keyword
()))
);
...
...
@@ -217,11 +217,11 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
}
else
{
if
(
wildCard
Entries_
.
size
()
>
0
)
if
(
pattern
Entries_
.
size
()
>
0
)
{
DLList
<
entry
*>::
const_iterator
wcLink
=
wildCard
Entries_
.
begin
();
DLList
<
entry
*>::
const_iterator
wcLink
=
pattern
Entries_
.
begin
();
DLList
<
autoPtr
<
regExp
>
>::
const_iterator
reLink
=
wildCard
Regexps_
.
begin
();
pattern
Regexps_
.
begin
();
// Find in patterns using regular expressions only
if
(
findInPatterns
(
true
,
keyword
,
wcLink
,
reLink
))
...
...
@@ -253,12 +253,12 @@ const Foam::entry* Foam::dictionary::lookupEntryPtr
if
(
iter
==
hashedEntries_
.
end
())
{
if
(
patternMatch
&&
wildCard
Entries_
.
size
()
>
0
)
if
(
patternMatch
&&
pattern
Entries_
.
size
()
>
0
)
{
DLList
<
entry
*>::
const_iterator
wcLink
=
wildCard
Entries_
.
begin
();
pattern
Entries_
.
begin
();
DLList
<
autoPtr
<
regExp
>
>::
const_iterator
reLink
=
wildCard
Regexps_
.
begin
();
pattern
Regexps_
.
begin
();
// Find in patterns using regular expressions only
if
(
findInPatterns
(
patternMatch
,
keyword
,
wcLink
,
reLink
))
...
...
@@ -292,12 +292,12 @@ Foam::entry* Foam::dictionary::lookupEntryPtr
if
(
iter
==
hashedEntries_
.
end
())
{
if
(
patternMatch
&&
wildCard
Entries_
.
size
()
>
0
)
if
(
patternMatch
&&
pattern
Entries_
.
size
()
>
0
)
{
DLList
<
entry
*>::
iterator
wcLink
=
wildCard
Entries_
.
begin
();
pattern
Entries_
.
begin
();
DLList
<
autoPtr
<
regExp
>
>::
iterator
reLink
=
wildCard
Regexps_
.
begin
();
pattern
Regexps_
.
begin
();
// Find in patterns using regular expressions only
if
(
findInPatterns
(
patternMatch
,
keyword
,
wcLink
,
reLink
))
...
...
@@ -499,8 +499,8 @@ bool Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
if
(
entryPtr
->
keyword
().
isPattern
())
{
wildCard
Entries_
.
insert
(
entryPtr
);
wildCard
Regexps_
.
insert
pattern
Entries_
.
insert
(
entryPtr
);
pattern
Regexps_
.
insert
(
autoPtr
<
regExp
>
(
new
regExp
(
entryPtr
->
keyword
()))
);
...
...
@@ -528,8 +528,8 @@ bool Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
if
(
entryPtr
->
keyword
().
isPattern
())
{
wildCard
Entries_
.
insert
(
entryPtr
);
wildCard
Regexps_
.
insert
pattern
Entries_
.
insert
(
entryPtr
);
pattern
Regexps_
.
insert
(
autoPtr
<
regExp
>
(
new
regExp
(
entryPtr
->
keyword
()))
);
...
...
@@ -622,14 +622,14 @@ bool Foam::dictionary::remove(const word& Keyword)
if
(
iter
!=
hashedEntries_
.
end
())
{
// Delete from patterns first
DLList
<
entry
*>::
iterator
wcLink
=
wildCard
Entries_
.
begin
();
DLList
<
autoPtr
<
regExp
>
>::
iterator
reLink
=
wildCard
Regexps_
.
begin
();
DLList
<
entry
*>::
iterator
wcLink
=
pattern
Entries_
.
begin
();
DLList
<
autoPtr
<
regExp
>
>::
iterator
reLink
=
pattern
Regexps_
.
begin
();
// Find in pattern using exact match only
if
(
findInPatterns
(
false
,
Keyword
,
wcLink
,
reLink
))
{
wildCard
Entries_
.
remove
(
wcLink
);
wildCard
Regexps_
.
remove
(
reLink
);
pattern
Entries_
.
remove
(
wcLink
);
pattern
Regexps_
.
remove
(
reLink
);
}
IDLList
<
entry
>::
remove
(
iter
());
...
...
@@ -689,15 +689,15 @@ bool Foam::dictionary::changeKeyword
{
// Delete from patterns first
DLList
<
entry
*>::
iterator
wcLink
=
wildCard
Entries_
.
begin
();
pattern
Entries_
.
begin
();
DLList
<
autoPtr
<
regExp
>
>::
iterator
reLink
=
wildCard
Regexps_
.
begin
();
pattern
Regexps_
.
begin
();
// Find in patterns using exact match only
if
(
findInPatterns
(
false
,
iter2
()
->
keyword
(),
wcLink
,
reLink
))
{
wildCard
Entries_
.
remove
(
wcLink
);
wildCard
Regexps_
.
remove
(
reLink
);
pattern
Entries_
.
remove
(
wcLink
);
pattern
Regexps_
.
remove
(
reLink
);
}
}
...
...
@@ -726,8 +726,8 @@ bool Foam::dictionary::changeKeyword
if
(
newKeyword
.
isPattern
())
{
wildCard
Entries_
.
insert
(
iter
());
wildCard
Regexps_
.
insert
pattern
Entries_
.
insert
(
iter
());
pattern
Regexps_
.
insert
(
autoPtr
<
regExp
>
(
new
regExp
(
newKeyword
))
);
...
...
@@ -793,8 +793,8 @@ void Foam::dictionary::clear()
{
IDLList
<
entry
>::
clear
();
hashedEntries_
.
clear
();
wildCard
Entries_
.
clear
();
wildCard
Regexps_
.
clear
();
pattern
Entries_
.
clear
();
pattern
Regexps_
.
clear
();
}
...
...
src/OpenFOAM/db/dictionary/dictionary.H
View file @
cc571ba1
...
...
@@ -93,10 +93,10 @@ class dictionary
const
dictionary
&
parent_
;
//- Entries of matching patterns
DLList
<
entry
*>
wildCard
Entries_
;
DLList
<
entry
*>
pattern
Entries_
;
//- Patterns as precompiled regular expressions
DLList
<
autoPtr
<
regExp
>
>
wildCard
Regexps_
;
DLList
<
autoPtr
<
regExp
>
>
pattern
Regexps_
;
// Private Member Functions
...
...
src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H
View file @
cc571ba1
...
...
@@ -74,20 +74,20 @@ public:
// Constructors
//- Construct from the parent dictionary and Istream
dictionaryEntry
(
const
dictionary
&
parentDict
,
Istream
&
is
);
dictionaryEntry
(
const
dictionary
&
parentDict
,
Istream
&
);
//- Construct from the keyword, parent dictionary and a Istream
dictionaryEntry
(
const
keyType
&
keyword
,
const
keyType
&
,
const
dictionary
&
parentDict
,
Istream
&
is
Istream
&
);
//- Construct from the keyword, parent dictionary and a dictionary
dictionaryEntry
(
const
keyType
&
keyword
,
const
keyType
&
,
const
dictionary
&
parentDict
,
const
dictionary
&
dict
);
...
...
@@ -96,7 +96,7 @@ public:
dictionaryEntry
(
const
dictionary
&
parentDict
,
const
dictionaryEntry
&
dictEnt
const
dictionaryEntry
&
);
autoPtr
<
entry
>
clone
(
const
dictionary
&
parentDict
)
const
...
...
@@ -158,10 +158,8 @@ public:
};
#if defined (__GNUC__)
template
<
>
#endif
Ostream
&
operator
<<
(
Ostream
&
os
,
const
InfoProxy
<
dictionaryEntry
>&
ip
);
Ostream
&
operator
<<
(
Ostream
&
,
const
InfoProxy
<
dictionaryEntry
>&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H
View file @
cc571ba1
...
...
@@ -75,32 +75,32 @@ public:
void
append
(
const
token
&
currToken
,
const
dictionary
&
dict
,
Istream
&
is
const
dictionary
&
,
Istream
&
);
//- Append the given tokens starting at the current tokenIndex
void
append
(
const
tokenList
&
varTokens
);
void
append
(
const
tokenList
&
);
//- Expand the given variable (keyword starts with $)
bool
expandVariable
(
const
word
&
keyword
,
const
dictionary
&
dict
);
bool
expandVariable
(
const
word
&
,
const
dictionary
&
);
//- Expand the given function (keyword starts with #)
bool
expandFunction
(
const
word
&
keyword
,
const
dictionary
&
dict
,
Istream
&
is
const
word
&
,
const
dictionary
&
,
Istream
&
);
//- Read tokens from the given stream
bool
read
(
const
dictionary
&
dict
,
Istream
&
);
bool
read
(
const
dictionary
&
,
Istream
&
);
//- Read the complete entry from the given stream
void
readEntry
(
const
dictionary
&
dict
,
Istream
&
);
void
readEntry
(
const
dictionary
&
,
Istream
&
);
//- Insert the given tokens at token i
void
insert
(
const
tokenList
&
varTokens
,
const
label
i
);
void
insert
(
const
tokenList
&
,
const
label
i
);
public:
...
...
@@ -108,13 +108,13 @@ public:
// Constructors
//- Construct from keyword and a Istream
primitiveEntry
(
const
keyType
&
keyword
,
Istream
&
);
primitiveEntry
(
const
keyType
&
,
Istream
&
);
//- Construct from keyword, parent dictionary and
a
Istream
primitiveEntry
(
const
keyType
&
keyword
,
const
dictionary
&
,
Istream
&
);
//- Construct from keyword, parent dictionary and Istream
primitiveEntry
(
const
keyType
&
,
const
dictionary
&
parentDict
,
Istream
&
);
//- Construct from keyword and a ITstream
primitiveEntry
(
const
keyType
&
keyword
,
const
ITstream
&
);
primitiveEntry
(
const
keyType
&
,
const
ITstream
&
);
//- Construct from keyword and a token
primitiveEntry
(
const
keyType
&
,
const
token
&
);
...
...
@@ -182,7 +182,7 @@ public:
template
<
>
Ostream
&
operator
<<
(
Ostream
&
os
,
const
InfoProxy
<
primitiveEntry
>&
ip
);
Ostream
&
operator
<<
(
Ostream
&
,
const
InfoProxy
<
primitiveEntry
>&
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/OpenFOAM/primitives/strings/keyType/keyType.H
View file @
cc571ba1
...
...
@@ -62,7 +62,8 @@ class keyType
{
// Private member data
bool
isWildCard_
;
//- Is the keyType a pattern (regular expression)
bool
isPattern_
;
// Private Member Functions
...
...
src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
View file @
cc571ba1
...
...
@@ -33,21 +33,21 @@ License
inline
Foam
::
keyType
::
keyType
()
:
word
(),
is
WildCard
_
(
false
)
is
Pattern
_
(
false
)
{}
inline
Foam
::
keyType
::
keyType
(
const
keyType
&
s
)
:
word
(
s
,
false
),
is
WildCard
_
(
s
.
isPattern
())
is
Pattern
_
(
s
.
isPattern
())
{}
inline
Foam
::
keyType
::
keyType
(
const
word
&
s
)
:
word
(
s
,
false
),
is
WildCard
_
(
false
)
is
Pattern
_
(
false
)
{}
...
...
@@ -55,7 +55,7 @@ inline Foam::keyType::keyType(const word& s)
inline
Foam
::
keyType
::
keyType
(
const
string
&
s
)
:
word
(
s
,
false
),
is
WildCard
_
(
true
)
is
Pattern
_
(
true
)
{}
...
...
@@ -63,7 +63,7 @@ inline Foam::keyType::keyType(const string& s)
inline
Foam
::
keyType
::
keyType
(
const
char
*
s
)
:
word
(
s
,
false
),
is
WildCard
_
(
false
)
is
Pattern
_
(
false
)
{}
...
...
@@ -75,7 +75,7 @@ inline Foam::keyType::keyType
)
:
word
(
s
,
false
),
is
WildCard
_
(
isPattern
)
is
Pattern
_
(
isPattern
)
{}
...
...
@@ -89,7 +89,7 @@ inline bool Foam::keyType::valid(char c)
bool
Foam
::
keyType
::
isPattern
()
const
{
return
is
WildCard
_
;
return
is
Pattern
_
;
}
...
...
@@ -99,14 +99,14 @@ inline void Foam::keyType::operator=(const keyType& s)
{
// Bypass checking
string
::
operator
=
(
s
);
is
WildCard
_
=
s
.
isPattern
()
;
is
Pattern
_
=
s
.
isPattern
_
;
}
inline
void
Foam
::
keyType
::
operator
=
(
const
word
&
s
)
{
word
::
operator
=
(
s
);
is
WildCard
_
=
false
;
is
Pattern
_
=
false
;
}
...
...
@@ -114,7 +114,7 @@ inline void Foam::keyType::operator=(const string& s)
{
// Bypass checking
string
::
operator
=
(
s
);
is
WildCard
_
=
true
;
is
Pattern
_
=
true
;
}
...
...
@@ -122,7 +122,7 @@ inline void Foam::keyType::operator=(const char* s)
{
// Bypass checking
string
::
operator
=
(
s
);
is
WildCard
_
=
false
;
is
Pattern
_
=
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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