diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-04-12 18:47:29 +0200 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2016-04-25 22:24:16 +0200 |
commit | 667d9c4a082552fb64c5ffe7b0bd6212c8a8b1b3 (patch) | |
tree | 100e8e3fbd86970dec9ef97c773419ac2bba291b /src/core/parser/utils/TokenizedData.hpp | |
parent | 0884afe16263a110597671f60dcb4ff7df66f456 (diff) |
Implement endAtWhitespace flag which tells TokenizedDataReader to stop reading data after the first whitespace character
Diffstat (limited to 'src/core/parser/utils/TokenizedData.hpp')
-rw-r--r-- | src/core/parser/utils/TokenizedData.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/parser/utils/TokenizedData.hpp b/src/core/parser/utils/TokenizedData.hpp index 95af95e..83821d7 100644 --- a/src/core/parser/utils/TokenizedData.hpp +++ b/src/core/parser/utils/TokenizedData.hpp @@ -307,11 +307,15 @@ public: * enabled tokens. * @param mode is the whitespace mode that should be used when a text token * is returned. + * @param endAtWhitespace if true, only delivers data until the first + * whitespace character after a sequence of non-whitespace characters. Does + * not affect the delivery of non-data tokens. * @return true if the operation was successful and there is a next token, * false if there are no more tokens. */ bool read(Token &token, const TokenSet &tokens = TokenSet{}, - WhitespaceMode mode = WhitespaceMode::TRIM); + WhitespaceMode mode = WhitespaceMode::TRIM, + bool endAtWhitespace = false); /** * Stores the next token in the given token reference, returns true if the @@ -323,11 +327,15 @@ public: * enabled tokens. * @param mode is the whitespace mode that should be used when a text token * is returned. + * @param endAtWhitespace if true, only delivers data until the first + * whitespace character after a sequence of non-whitespace characters. Does + * not affect the delivery of non-data tokens. * @return true if the operation was successful and there is a next token, * false if there are no more tokens. */ bool peek(Token &token, const TokenSet &tokens = TokenSet{}, - WhitespaceMode mode = WhitespaceMode::TRIM); + WhitespaceMode mode = WhitespaceMode::TRIM, + bool endAtWhitespace = false); /** * Consumes the peeked tokens, the read cursor will now be at the position |