ENH: handle keyType type (literal/regex) as enum instead of bool

- makes its use somewhat clearer and allows more future options
This commit is contained in:
Mark Olesen
2019-08-20 13:48:05 +02:00
committed by Andrew Heather
parent dade6957c8
commit b5342c166c
10 changed files with 105 additions and 67 deletions

View File

@ -96,7 +96,7 @@ int main(int argc, char *argv[])
{
dictionary dict(IFstream("testDictRegex")());
dict.add(keyType("fooba[rz]", true), "anything");
dict.add(keyType("fooba[rz]", keyType::REGEX), "anything");
dict.writeEntry("testDictRegex", Info);
Info<< nl

View File

@ -184,7 +184,7 @@ int main(int argc, char *argv[])
if (names[nameI] != oldNames[nameI])
{
// make "(abc|def)" pattern
keyType renamed( "(" + names[nameI] + ")", true);
keyType renamed("(" + names[nameI] + ")", keyType::REGEX);
solverDict.changeKeyword(oldNames[nameI], renamed);

View File

@ -60,7 +60,7 @@ int main(int argc, char *argv[])
Foam::string s2("this .* file");
const char * s3 = "this .* file";
keyType keyre("x.*", true);
keyType keyre("x.*", keyType::REGEX);
wordReList wordrelist
{