Documentation

In extends Stream

Interface \Hoa\Stream\IStream\In.

Interface for input.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Methods

eof()  : bool
Test for end-of-stream.
getStream()  : resource
Get the current stream.
read()  : string
Read n characters.
readAll()  : string
Read all, i.e. read as much as possible.
readArray()  : array<string|int, mixed>
Read an array.
readBoolean()  : bool
Read a boolean.
readCharacter()  : string
Read a character.
readFloat()  : float
Read a float.
readInteger()  : int
Read an integer.
readLine()  : string
Read a line.
readString()  : string
Alias of $this->read().
scanf()  : array<string|int, mixed>
Parse input from a stream according to a format.

Methods

eof()

Test for end-of-stream.

public eof() : bool
Return values
bool

getStream()

Get the current stream.

public getStream() : resource
Return values
resource

read()

Read n characters.

public read(int $length) : string
Parameters
$length : int

Length.

Return values
string

readAll()

Read all, i.e. read as much as possible.

public readAll([int $offset = 0 ]) : string
Parameters
$offset : int = 0

Offset.

Return values
string

readArray()

Read an array.

public readArray([mixed $argument = null ]) : array<string|int, mixed>

In most cases, it could be an alias to the $this->scanf() method.

Parameters
$argument : mixed = null

Argument (because the behavior is very different according to the implementation).

Return values
array<string|int, mixed>

readBoolean()

Read a boolean.

public readBoolean() : bool
Return values
bool

readCharacter()

Read a character.

public readCharacter() : string

It could be equivalent to $this->read(1).

Return values
string

readFloat()

Read a float.

public readFloat([int $length = 1 ]) : float
Parameters
$length : int = 1

Length.

Return values
float

readInteger()

Read an integer.

public readInteger([int $length = 1 ]) : int
Parameters
$length : int = 1

Length.

Return values
int

readLine()

Read a line.

public readLine() : string
Return values
string

readString()

Alias of $this->read().

public readString(int $length) : string
Parameters
$length : int

Length.

Return values
string

scanf()

Parse input from a stream according to a format.

public scanf(string $format) : array<string|int, mixed>
Parameters
$format : string

Format (see printf's formats).

Return values
array<string|int, mixed>

        
On this page

Search results