new wordRe class - a word that holds a regExp

- a possible future replacement for keyType, but the immediate use is the
    wordReList for grepping through other lists.
  - note that the argList treatment of '(' ... ')' yields quoted strings,
    which we can use for building a wordReList

minor cleanup of regExp class

  - constructor from std::string, match std::string and
    operator=(std::string&)
    rely on automatic conversion to Foam::string
  - ditch partialMatch with sub-groups, it doesn't make much sense
This commit is contained in:
Mark Olesen
2009-01-04 00:33:27 +01:00
parent 1d866d7fe8
commit 2717aa5c7d
19 changed files with 1036 additions and 182 deletions

View File

@ -39,14 +39,9 @@ const Foam::string Foam::string::null;
// Count and return the number of a given character in the string
Foam::string::size_type Foam::string::count(const char c) const
{
register size_type cCount=0;
register size_type cCount = 0;
for
(
const_iterator iter = begin();
iter != end();
++iter
)
for (const_iterator iter = begin(); iter != end(); ++iter)
{
if (*iter == c)
{
@ -269,9 +264,9 @@ bool Foam::string::removeRepeated(const char character)
// Return string with repeated characters removed
Foam::string Foam::string::removeRepeated(const char character) const
{
string s(*this);
s.removeRepeated(character);
return s;
string str(*this);
str.removeRepeated(character);
return str;
}
@ -294,9 +289,9 @@ bool Foam::string::removeTrailing(const char character)
// Return string with trailing character removed
Foam::string Foam::string::removeTrailing(const char character) const
{
string s(*this);
s.removeTrailing(character);
return s;
string str(*this);
str.removeTrailing(character);
return str;
}