#include <LexerTextStream.h>
Implement convenient support for lexing SPARQL/Turtle-like languages.
It allows:
◆ LexerTextStream() [1/2]
LexerTextStream::LexerTextStream |
( |
QIODevice * | sstream | ) |
|
Construct a stream reading from a QIODevice. With this constructor, LexerTextStream uses an internal buffer.
◆ LexerTextStream() [2/2]
LexerTextStream::LexerTextStream |
( |
const QString & | string | ) |
|
Construct a stream reading from a QString. With this constructor, LexerTextStream 's internal buffer is equal to string.
◆ bufferSize()
std::size_t LexerTextStream::bufferSize |
( |
| ) |
|
- Returns
- how many bytes are read in the buffer at once
◆ currentBufferSize()
std::size_t LexerTextStream::currentBufferSize |
( |
| ) |
|
- Returns
- the number of bytes currently held in the internal buffer
This value might differs from bufferSize for various reasons:
- not enough data was available in the stream
- if LexerTextStream was initialised with a string, the buffer is equal to the string and the currentBufferSize is equal to the length of the string
- when reading a string, the entire string has to be contained in the buffer
◆ getDigit()
Read a digit, the boolean is true if integer
◆ getNextChar()
- Returns
- the next char and increment the column counter.
◆ getNextNonSeparatorChar()
- Returns
- the next char that is not a separator (space, tab, return...)
◆ getString()
Read a string, the boolean is true if the terminator was found, false otherwise
◆ setBufferSize()
void LexerTextStream::setBufferSize |
( |
std::size_t | _size | ) |
|
Set how many bytes are read in the buffer to _size.
◆ unget()
Cancel the reading of the previous char.
The documentation for this class was generated from the following files: