From d710bf02517225662e80eeeaf93149cfe50c872d Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 8 Feb 2015 21:13:12 +0100 Subject: Added "expect" function to CharReader --- src/core/common/CharReader.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/common/CharReader.hpp') diff --git a/src/core/common/CharReader.hpp b/src/core/common/CharReader.hpp index cbfeaf2..64c80af 100644 --- a/src/core/common/CharReader.hpp +++ b/src/core/common/CharReader.hpp @@ -489,6 +489,15 @@ public: */ bool read(char &c); + /** + * Peeks a character, checks whether this character equals the given + * character -- and if yes -- consumes the peek, otherwise resets it. + * + * @param c is the character that is expected. + * @return true if this character is actually next. + */ + bool expect(char c); + /** * Resets the peek pointer to the "read" pointer. */ -- cgit v1.2.3