mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
removed last bits of wildcard vs. pattern
This commit is contained in:
@ -46,9 +46,9 @@ bool Foam::dictionary::findInPatterns
|
||||
DLList<autoPtr<regExp> >::const_iterator& reLink
|
||||
) const
|
||||
{
|
||||
if (wildCardEntries_.size() > 0)
|
||||
if (patternEntries_.size() > 0)
|
||||
{
|
||||
while (wcLink != wildCardEntries_.end())
|
||||
while (wcLink != patternEntries_.end())
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -76,9 +76,9 @@ bool Foam::dictionary::findInPatterns
|
||||
DLList<autoPtr<regExp> >::iterator& reLink
|
||||
)
|
||||
{
|
||||
if (wildCardEntries_.size() > 0)
|
||||
if (patternEntries_.size() > 0)
|
||||
{
|
||||
while (wcLink != wildCardEntries_.end())
|
||||
while (wcLink != patternEntries_.end())
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -127,8 +127,8 @@ Foam::dictionary::dictionary
|
||||
|
||||
if (iter().keyword().isPattern())
|
||||
{
|
||||
wildCardEntries_.insert(&iter());
|
||||
wildCardRegexps_.insert
|
||||
patternEntries_.insert(&iter());
|
||||
patternRegexps_.insert
|
||||
(
|
||||
autoPtr<regExp>(new regExp(iter().keyword()))
|
||||
);
|
||||
@ -157,8 +157,8 @@ Foam::dictionary::dictionary
|
||||
|
||||
if (iter().keyword().isPattern())
|
||||
{
|
||||
wildCardEntries_.insert(&iter());
|
||||
wildCardRegexps_.insert
|
||||
patternEntries_.insert(&iter());
|
||||
patternRegexps_.insert
|
||||
(
|
||||
autoPtr<regExp>(new regExp(iter().keyword()))
|
||||
);
|
||||
@ -217,11 +217,11 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wildCardEntries_.size() > 0)
|
||||
if (patternEntries_.size() > 0)
|
||||
{
|
||||
DLList<entry*>::const_iterator wcLink = wildCardEntries_.begin();
|
||||
DLList<entry*>::const_iterator wcLink = patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::const_iterator reLink =
|
||||
wildCardRegexps_.begin();
|
||||
patternRegexps_.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 && wildCardEntries_.size() > 0)
|
||||
if (patternMatch && patternEntries_.size() > 0)
|
||||
{
|
||||
DLList<entry*>::const_iterator wcLink =
|
||||
wildCardEntries_.begin();
|
||||
patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::const_iterator reLink =
|
||||
wildCardRegexps_.begin();
|
||||
patternRegexps_.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 && wildCardEntries_.size() > 0)
|
||||
if (patternMatch && patternEntries_.size() > 0)
|
||||
{
|
||||
DLList<entry*>::iterator wcLink =
|
||||
wildCardEntries_.begin();
|
||||
patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::iterator reLink =
|
||||
wildCardRegexps_.begin();
|
||||
patternRegexps_.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())
|
||||
{
|
||||
wildCardEntries_.insert(entryPtr);
|
||||
wildCardRegexps_.insert
|
||||
patternEntries_.insert(entryPtr);
|
||||
patternRegexps_.insert
|
||||
(
|
||||
autoPtr<regExp>(new regExp(entryPtr->keyword()))
|
||||
);
|
||||
@ -528,8 +528,8 @@ bool Foam::dictionary::add(entry* entryPtr, bool mergeEntry)
|
||||
|
||||
if (entryPtr->keyword().isPattern())
|
||||
{
|
||||
wildCardEntries_.insert(entryPtr);
|
||||
wildCardRegexps_.insert
|
||||
patternEntries_.insert(entryPtr);
|
||||
patternRegexps_.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 = wildCardEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::iterator reLink = wildCardRegexps_.begin();
|
||||
DLList<entry*>::iterator wcLink = patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::iterator reLink = patternRegexps_.begin();
|
||||
|
||||
// Find in pattern using exact match only
|
||||
if (findInPatterns(false, Keyword, wcLink, reLink))
|
||||
{
|
||||
wildCardEntries_.remove(wcLink);
|
||||
wildCardRegexps_.remove(reLink);
|
||||
patternEntries_.remove(wcLink);
|
||||
patternRegexps_.remove(reLink);
|
||||
}
|
||||
|
||||
IDLList<entry>::remove(iter());
|
||||
@ -689,15 +689,15 @@ bool Foam::dictionary::changeKeyword
|
||||
{
|
||||
// Delete from patterns first
|
||||
DLList<entry*>::iterator wcLink =
|
||||
wildCardEntries_.begin();
|
||||
patternEntries_.begin();
|
||||
DLList<autoPtr<regExp> >::iterator reLink =
|
||||
wildCardRegexps_.begin();
|
||||
patternRegexps_.begin();
|
||||
|
||||
// Find in patterns using exact match only
|
||||
if (findInPatterns(false, iter2()->keyword(), wcLink, reLink))
|
||||
{
|
||||
wildCardEntries_.remove(wcLink);
|
||||
wildCardRegexps_.remove(reLink);
|
||||
patternEntries_.remove(wcLink);
|
||||
patternRegexps_.remove(reLink);
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,8 +726,8 @@ bool Foam::dictionary::changeKeyword
|
||||
|
||||
if (newKeyword.isPattern())
|
||||
{
|
||||
wildCardEntries_.insert(iter());
|
||||
wildCardRegexps_.insert
|
||||
patternEntries_.insert(iter());
|
||||
patternRegexps_.insert
|
||||
(
|
||||
autoPtr<regExp>(new regExp(newKeyword))
|
||||
);
|
||||
@ -793,8 +793,8 @@ void Foam::dictionary::clear()
|
||||
{
|
||||
IDLList<entry>::clear();
|
||||
hashedEntries_.clear();
|
||||
wildCardEntries_.clear();
|
||||
wildCardRegexps_.clear();
|
||||
patternEntries_.clear();
|
||||
patternRegexps_.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -93,10 +93,10 @@ class dictionary
|
||||
const dictionary& parent_;
|
||||
|
||||
//- Entries of matching patterns
|
||||
DLList<entry*> wildCardEntries_;
|
||||
DLList<entry*> patternEntries_;
|
||||
|
||||
//- Patterns as precompiled regular expressions
|
||||
DLList<autoPtr<regExp> > wildCardRegexps_;
|
||||
DLList<autoPtr<regExp> > patternRegexps_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
@ -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>&);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -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>&);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -62,7 +62,8 @@ class keyType
|
||||
{
|
||||
// Private member data
|
||||
|
||||
bool isWildCard_;
|
||||
//- Is the keyType a pattern (regular expression)
|
||||
bool isPattern_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
@ -33,21 +33,21 @@ License
|
||||
inline Foam::keyType::keyType()
|
||||
:
|
||||
word(),
|
||||
isWildCard_(false)
|
||||
isPattern_(false)
|
||||
{}
|
||||
|
||||
|
||||
inline Foam::keyType::keyType(const keyType& s)
|
||||
:
|
||||
word(s, false),
|
||||
isWildCard_(s.isPattern())
|
||||
isPattern_(s.isPattern())
|
||||
{}
|
||||
|
||||
|
||||
inline Foam::keyType::keyType(const word& s)
|
||||
:
|
||||
word(s, false),
|
||||
isWildCard_(false)
|
||||
isPattern_(false)
|
||||
{}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ inline Foam::keyType::keyType(const word& s)
|
||||
inline Foam::keyType::keyType(const string& s)
|
||||
:
|
||||
word(s, false),
|
||||
isWildCard_(true)
|
||||
isPattern_(true)
|
||||
{}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ inline Foam::keyType::keyType(const string& s)
|
||||
inline Foam::keyType::keyType(const char* s)
|
||||
:
|
||||
word(s, false),
|
||||
isWildCard_(false)
|
||||
isPattern_(false)
|
||||
{}
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ inline Foam::keyType::keyType
|
||||
)
|
||||
:
|
||||
word(s, false),
|
||||
isWildCard_(isPattern)
|
||||
isPattern_(isPattern)
|
||||
{}
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ inline bool Foam::keyType::valid(char c)
|
||||
|
||||
bool Foam::keyType::isPattern() const
|
||||
{
|
||||
return isWildCard_;
|
||||
return isPattern_;
|
||||
}
|
||||
|
||||
|
||||
@ -99,14 +99,14 @@ inline void Foam::keyType::operator=(const keyType& s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isWildCard_ = s.isPattern();
|
||||
isPattern_ = s.isPattern_;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const word& s)
|
||||
{
|
||||
word::operator=(s);
|
||||
isWildCard_ = false;
|
||||
isPattern_ = false;
|
||||
}
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ inline void Foam::keyType::operator=(const string& s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isWildCard_ = true;
|
||||
isPattern_ = true;
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ inline void Foam::keyType::operator=(const char* s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isWildCard_ = false;
|
||||
isPattern_ = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user