Commit e247e063 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: ITstream single token append method

- remove/fully deprecated newElmt in next release
parent 1847bd16
......@@ -402,6 +402,26 @@ void Foam::ITstream::seek(label pos)
}
void Foam::ITstream::append(const token& t, const bool lazy)
{
reserveCapacity(tokenIndex_ + 1, lazy);
tokenList& toks = *this;
toks[tokenIndex_] = t; // copy append
++tokenIndex_;
}
void Foam::ITstream::append(token&& t, const bool lazy)
{
reserveCapacity(tokenIndex_ + 1, lazy);
tokenList& toks = *this;
toks[tokenIndex_] = std::move(t); // move append
++tokenIndex_;
}
void Foam::ITstream::append(const tokenList& newTokens, const bool lazy)
{
reserveCapacity(tokenIndex_ + newTokens.size(), lazy);
......
......@@ -297,6 +297,14 @@ public:
// Edit
//- Copy append a token at the current tokenIndex,
//- incrementing the index.
void append(const token& t, const bool lazy);
//- Move append a token at the current tokenIndex,
//- incrementing the index.
void append(token&& t, const bool lazy);
//- Copy append a tokenList at the current tokenIndex,
//- incrementing the index.
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment