Introduced properties

Redefined properties

redef type SELF: StreamCat

filter_stream $ StreamCat :: SELF

Type of this instance, automatically specialized in every class
redef fun close

filter_stream $ StreamCat :: close

close the stream
redef fun eof: Bool

filter_stream $ StreamCat :: eof

Is there something to read.
redef fun read_char: nullable Char

filter_stream $ StreamCat :: read_char

Reads a character. Returns null on EOF or timeout
redef fun stream: nullable Reader

filter_stream $ StreamCat :: stream

Filter readed elements

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun append_line_to(s: Buffer)

core :: Reader :: append_line_to

Read a string until the end of the line and append it to s.
fun big_endian: Bool

binary :: BinaryStream :: big_endian

Use the big-endian convention? otherwise use little-endian.
fun big_endian=(big_endian: Bool)

binary :: BinaryStream :: big_endian=

Use the big-endian convention? otherwise use little-endian.
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
abstract fun close

core :: Stream :: close

close the stream
fun codec: Codec

core :: Stream :: codec

Codec used to transform raw data to text
fun codec=(c: Codec)

core :: Stream :: codec=

Change the codec for this stream.
fun deserialize_msgpack(static_type: nullable String): nullable Object

core :: Reader :: deserialize_msgpack

Deserialize full Nit nullable Object from MessagePack formated data
fun each_line: LineIterator

core :: Reader :: each_line

Return an iterator that read each line.
fun eof: Bool

core :: Reader :: eof

Is there something to read.
fun finish

core :: Stream :: finish

Post-work hook.
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun last_error: nullable IOError

core :: Stream :: last_error

Error produced by the file stream
protected fun last_error=(last_error: nullable IOError)

core :: Stream :: last_error=

Error produced by the file stream
protected fun lookahead: CString

core :: Stream :: lookahead

Lookahead buffer for codecs
protected fun lookahead=(lookahead: CString)

core :: Stream :: lookahead=

Lookahead buffer for codecs
protected fun lookahead_capacity: Int

core :: Stream :: lookahead_capacity

Capacity of the lookahead
protected fun lookahead_capacity=(lookahead_capacity: Int)

core :: Stream :: lookahead_capacity=

Capacity of the lookahead
protected fun lookahead_length: Int

core :: Stream :: lookahead_length

Current occupation of the lookahead
protected fun lookahead_length=(lookahead_length: Int)

core :: Stream :: lookahead_length=

Current occupation of the lookahead
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
protected abstract fun raw_read_byte: Int

core :: Reader :: raw_read_byte

Read a byte directly from the underlying stream, without
protected fun raw_read_bytes(buf: CString, max: Int): Int

core :: Reader :: raw_read_bytes

Read at most max bytes from the underlying stream into buf,
fun read(i: Int): String

core :: Reader :: read

Reads a String of at most i length
fun read_all: String

core :: Reader :: read_all

Read all the stream until the eof.
fun read_all_bytes: Bytes

core :: Reader :: read_all_bytes

Read all the stream until the eof.
fun read_bits: Array[Bool]

core :: Reader :: read_bits

Get an Array of 8 Bool by reading a single byte
fun read_block: String

core :: Reader :: read_block

Read the length as a 64 bits integer, then the content of the block
fun read_bool: Bool

core :: Reader :: read_bool

Read a single byte and return true if its value is different than 0
fun read_byte: Int

core :: Reader :: read_byte

Reads a byte. Returns a negative value on error
fun read_bytes(max: Int): Bytes

core :: Reader :: read_bytes

Reads up to max bytes from source
fun read_bytes_to_cstring(bytes: CString, max: Int): Int

core :: Reader :: read_bytes_to_cstring

Reads up to max bytes from source and stores them in bytes
fun read_char: nullable Char

core :: Reader :: read_char

Reads a character. Returns null on EOF or timeout
fun read_double: Float

core :: Reader :: read_double

Read a floating point on 64 bits and return it as a Float
fun read_float: Float

core :: Reader :: read_float

Read a floating point on 32 bits and return it as a Float
fun read_int64: Int

core :: Reader :: read_int64

Read a signed integer on 64 bits and return is an Int
fun read_line: String

core :: Reader :: read_line

Read a string until the end of the line.
fun read_lines: Array[String]

core :: Reader :: read_lines

Read all the lines until the eof.
fun read_msgpack: nullable Serializable

core :: Reader :: read_msgpack

Read the next MessagePack object and return it as a simple Nit object
fun read_nonwhitespace: nullable Char

core :: Reader :: read_nonwhitespace

Skip whitespace characters (if any) then return the following non-whitespace character.
fun read_string: String

core :: Reader :: read_string

Read a null terminated string
fun read_word: String

core :: Reader :: read_word

Read the next sequence of non whitespace characters.
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
protected fun set_codec(codec: Codec)

core :: Stream :: set_codec

Codec used to transform raw data to text
fun start

core :: Stream :: start

Pre-work hook.
fun stream: nullable Reader

filter_stream :: FilterReader :: stream

Filter readed elements
protected fun stream=(stream: nullable Reader)

filter_stream :: FilterReader :: stream=

Filter readed elements
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
protected fun write_buffer: CString

core :: Stream :: write_buffer

Buffer for writing data to a stream
protected fun write_buffer=(write_buffer: CString)

core :: Stream :: write_buffer=

Buffer for writing data to a stream
package_diagram filter_stream::StreamCat StreamCat filter_stream::FilterReader FilterReader filter_stream::StreamCat->filter_stream::FilterReader core::Reader Reader filter_stream::FilterReader->core::Reader ...core::Reader ... ...core::Reader->core::Reader

Ancestors

abstract class BinaryStream

binary :: BinaryStream

A stream of binary data
interface Object

core :: Object

The root of the class hierarchy.
abstract class Reader

core :: Reader

A Stream that can be read from
abstract class Stream

core :: Stream

Any kind of stream to read/write/both to or from a source

Parents

Class definitions

filter_stream $ StreamCat
class StreamCat
	super FilterReader
	private var streams: Iterator[Reader]

	redef fun eof: Bool
	do
		if stream == null then
			return true
		else if stream.eof then
			stream.close
			stream = null
			return eof
		else
			return false
		end
	end

	redef fun stream: nullable Reader
	do
		var res = super
		if res == null and _streams.is_ok then
			res = _streams.item
			stream = res
			assert stream != null
			_streams.next
		end
		return res
	end

	redef fun read_char
	do
		assert not eof
		return stream.read_char
	end

	redef fun close
	do
		while stream != null do
			stream.close
			stream = null
		end
	end

	init with_streams(streams: Array[Reader])
	do
		_streams = streams.iterator
	end

	init(streams: Reader ...) is old_style_init do
		_streams = streams.iterator
	end
end
lib/filter_stream/filter_stream.nit:39,1--90,3