Added missing method implementation to tokenizer.

This commit is contained in:
Patrick Lühne 2017-06-17 17:56:48 +02:00
parent f349b5e351
commit 8288345bcb
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -61,8 +61,8 @@ class Tokenizer: public Stream, public TokenizerPolicy
// TODO: refactor // TODO: refactor
std::string getIdentifier(); std::string getIdentifier();
bool testIdentifierAndReturn(const std::string &identifier);
bool testIdentifierAndSkip(const std::string &identifier); bool testIdentifierAndSkip(const std::string &identifier);
bool testIdentifierAndReturn(const std::string &identifier);
// TODO: remove // TODO: remove
bool probeNumber(); bool probeNumber();
@ -223,6 +223,20 @@ std::string Tokenizer<TokenizerPolicy>::getIdentifier()
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
template<class TokenizerPolicy>
bool Tokenizer<TokenizerPolicy>::testIdentifierAndReturn(const std::string &expectedValue)
{
const auto previousPosition = position();
const auto result = testIdentifierAndSkip(expectedValue);
seek(previousPosition);
return result;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
template<class TokenizerPolicy> template<class TokenizerPolicy>
bool Tokenizer<TokenizerPolicy>::testIdentifierAndSkip(const std::string &expectedValue) bool Tokenizer<TokenizerPolicy>::testIdentifierAndSkip(const std::string &expectedValue)
{ {