ENH: enhancements to behaviour of token

- improved memory alignment reduces overhead for Int32 compilation

- added move/swap semantics

- made the type() readonly in favour of setVariant() to allow change
  of variant within a particular storage representation.
  Eg, STRING -> VERBATIMSTRING.
This commit is contained in:
Mark Olesen
2017-11-05 20:05:28 +01:00
parent e1b71c028c
commit c4de3e0a4d
14 changed files with 965 additions and 642 deletions

View File

@ -33,6 +33,7 @@ Description
#include "IFstream.H"
#include "StringStream.H"
#include "cpuTime.H"
#include "DynamicList.H"
using namespace Foam;
@ -69,6 +70,8 @@ int main(int argc, char *argv[])
IStringStream is(rawArg);
DynamicList<token> tokens;
while (is.good())
{
token tok(is);
@ -83,12 +86,23 @@ int main(int argc, char *argv[])
<< " lookahead: '" << char(lookahead) << "'"
<< endl;
}
if (tok.good())
{
tokens.append(std::move(tok));
if (verbose)
{
Info<< "after append: " << tok.info() << endl;
}
}
}
if (verbose)
{
Info<< nl;
IOobject::writeDivider(Info);
Info<< "tokenList:" << tokens << endl;
}
}
}