reworked regExp + wordRe a bit, minor change to keyType
regExp: - added optional ignoreCase for constructor. - the compile() methods is now exposed as set(...) method with an optional ignoreCase argument. Not currently much use for the other regex compile flags though. The set() method can be used directly instead of the operator=() assignment. keyType + wordRe: - it's not clear that any particular characters are valid/invalid (compared to string or word), so just drop the valid(char) method for now wordRe: - a bool doesn't suffice, added enum compOption (compile-option) - most constructors now have a compOption. In *all* cases it defaults to LITERAL - ie, the same behaviour for std::string and Foam::string - added set(...) methods that do much the same as operator=(...), but the compOption can be specified. In all cases, it defaults to DETECT. In Summary By default the constructors will generally preserve the argument as string literal and the assignment operators will use the wordRe::DETECT compOption to scan the string for regular expression meta characters and/or invalid word characters and react accordingly. The exceptions are when constructing/assigning from another Foam::wordRe (preserve the same type) or from a Foam::word (always literal).
Showing
- applications/test/wordRe/testRegexps 2 additions, 1 deletionapplications/test/wordRe/testRegexps
- applications/test/wordRe/wordReTest.C 34 additions, 19 deletionsapplications/test/wordRe/wordReTest.C
- src/OSspecific/Unix/regExp.C 39 additions, 30 deletionssrc/OSspecific/Unix/regExp.C
- src/OSspecific/Unix/regExp.H 26 additions, 12 deletionssrc/OSspecific/Unix/regExp.H
- src/OpenFOAM/primitives/strings/keyType/keyType.H 0 additions, 3 deletionssrc/OpenFOAM/primitives/strings/keyType/keyType.H
- src/OpenFOAM/primitives/strings/keyType/keyTypeI.H 1 addition, 7 deletionssrc/OpenFOAM/primitives/strings/keyType/keyTypeI.H
- src/OpenFOAM/primitives/strings/wordRe/wordRe.H 59 additions, 38 deletionssrc/OpenFOAM/primitives/strings/wordRe/wordRe.H
- src/OpenFOAM/primitives/strings/wordRe/wordReI.H 53 additions, 57 deletionssrc/OpenFOAM/primitives/strings/wordRe/wordReI.H
- src/OpenFOAM/primitives/strings/wordRe/wordReIO.C 4 additions, 7 deletionssrc/OpenFOAM/primitives/strings/wordRe/wordReIO.C
Please register or sign in to comment