ENH: minor improvements, cleanup of token class

- relax casting rules
  * down-cast of labelToken to boolToken
  * up-cast of wordToken to stringToken.
    Can use isStringType() test for word or string types

- simplify constructors, move construct etc.

- expose reset() method as public, which resets to UNDEFINED and
  clears allocated storage etc.

DEFEATURE: remove assign from word or string pointer.

- This was deprecated 2017-11 and now removed.
  For this type of content transfer, move assignment should be used
  instead of stealing pointers.
This commit is contained in:
Mark Olesen
2019-08-20 17:48:31 +02:00
committed by Andrew Heather
parent b5342c166c
commit c9cb4ce34f
7 changed files with 192 additions and 232 deletions

View File

@ -34,7 +34,7 @@ Foam::token Foam::dictionaryTokens::keywordToken(const entry& e)
if (k.empty())
{
return token::undefinedToken;
return token();
}
if (k.isPattern())
{