mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: wordRe: assignment from keyType not handled
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,6 +52,7 @@ SourceFiles
|
||||
|
||||
#include "word.H"
|
||||
#include "regExp.H"
|
||||
#include "keyType.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -60,7 +61,6 @@ namespace Foam
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class wordRe;
|
||||
|
||||
class Istream;
|
||||
class Ostream;
|
||||
|
||||
@ -118,6 +118,9 @@ public:
|
||||
//- Construct as copy
|
||||
inline wordRe(const wordRe&);
|
||||
|
||||
//- Construct from keyType
|
||||
inline wordRe(const keyType&, const compOption=LITERAL);
|
||||
|
||||
//- Construct as copy of word
|
||||
inline wordRe(const word&);
|
||||
|
||||
@ -196,6 +199,10 @@ public:
|
||||
//- Copy word, never a regular expression
|
||||
inline const wordRe& operator=(const word&);
|
||||
|
||||
//- Copy keyType, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline const wordRe& operator=(const keyType&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline const wordRe& operator=(const string&);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,6 +65,18 @@ inline Foam::wordRe::wordRe(const word& str)
|
||||
{}
|
||||
|
||||
|
||||
inline Foam::wordRe::wordRe(const keyType& str, const compOption opt)
|
||||
:
|
||||
word(str, false),
|
||||
re_()
|
||||
{
|
||||
if (str.isPattern())
|
||||
{
|
||||
compile(opt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline Foam::wordRe::wordRe(const char* str, const compOption opt)
|
||||
:
|
||||
word(str, false),
|
||||
@ -236,6 +248,17 @@ inline const Foam::wordRe& Foam::wordRe::operator=(const word& str)
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const keyType& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
if (str.isPattern())
|
||||
{
|
||||
compile();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
|
||||
Reference in New Issue
Block a user