up: IO     index Zimbu documentation

CLASS IO.StringReader @public

summary

     

A Reader that reads characters from a string.

It can also read bytes.

This is usually more efficient than using a character index on the string.

 
Implements IO.I_CharReader
Implements IO.I_ByteReader
 
NEW(data) @public  Creates a ByteReader that reads from data.
$readChar() int @public  Reads and returns one character.
$readByte() int @public  Reads and returns one byte.
 

members (alphabetically)

     

PROC NEW(string data) @public

     

Creates a ByteReader that reads from data.

FUNC $readByte() int @public

     

Reads and returns one byte.

When at the end of the string returns IO.eof.

FUNC $readChar() int @public

     

Reads and returns one character.

When at the end of the string returns IO.eof. When encountering an illegal UTF-8 character returns -1 and skips over it.

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0