diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-04-10 16:02:55 +0200 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2016-04-25 22:24:13 +0200 |
commit | 5e2dee7ac9a6ecb8f1d9e5d829d82109168b5b42 (patch) | |
tree | 84cfc8c5369d98aa339e2b9aa81f18d40f729006 /src/core/parser/utils/TokenizedData.hpp | |
parent | 579b0e14d3bc1345512cac00a83159569cfcfa00 (diff) |
Implement hasNonWhitespaceChar, lastCharIsWhitespace and firstCharIsWhitespace methods for TokenizedData class
Diffstat (limited to 'src/core/parser/utils/TokenizedData.hpp')
-rw-r--r-- | src/core/parser/utils/TokenizedData.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/parser/utils/TokenizedData.hpp b/src/core/parser/utils/TokenizedData.hpp index bc937f2..95af95e 100644 --- a/src/core/parser/utils/TokenizedData.hpp +++ b/src/core/parser/utils/TokenizedData.hpp @@ -144,6 +144,14 @@ public: bool protect = false); /** + * Marks the whitespace character at the given buffer position as protected. + * + * @param bufPos is the position of the character for which the "protected" + * flag should be set. + */ + void protect(size_t bufPos); + + /** * Stores a token ending at the last character of the current buffer. * * @param id is the id of the token for which the mark should be stored. @@ -208,6 +216,31 @@ public: * the internal buffer. */ TokenizedDataReader reader() const; + + /** + * Returns true if at least one non-whitespace character is stored in the + * TokenizedData structure. + * + * @return true if the at least one character in the TokenizedData structure + * is a non-whitespace character. + */ + bool hasNonWhitespaceChar() const; + + /** + * Returns true if the last character of the TokenizedData structure is a + * whitespace character. + * + * @return true if the last character is a whitespace character. + */ + bool lastCharIsWhitespace() const; + + /** + * Returns true if the first character of the TokenizedData structure is a + * whitespace character. + * + * @return true if the first character is a whitespace character. + */ + bool firstCharIsWhitespace() const; }; /** |