streamParser | R Documentation |
Generic interface for character processing. It allows going forward sequentially or backwards to a previous arbitrary position.
Each one of these functions performs an operation on or obtains information from a character sequence (stream).
streamParserNextChar(stream) streamParserNextCharSeq(stream) streamParserPosition(stream) streamParserClose(stream)
stream |
object containing information about the text to be processed and, specifically, about the next character to be read |
streamParserNextChar
Reads next character, checking if position to be read is correct.
streamParserNextCharSeq
Reads next character, without checking if position to be read is correct. Implemented since it is faster than streamParserNextChar
streamParserPosition
Returns information about text position being read.
streamParserClose
Closes the stream
streamParserNextChar and streamParserNextCharSeq |
Three field list:
|
streamParserPosition |
Three field list:
|
streamParserClose |
NULL |
streamParserFromFileName
streamParserFromString
stream<- streamParserFromString("Hello world") cstream <- streamParserNextChar(stream) while( cstream$status == "ok" ) { print(streamParserPosition(cstream$stream)) print(cstream$char) cstream <- streamParserNextCharSeq(cstream$stream) } streamParserClose(stream)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.