Provides file-like methods for manipulating a string instead of a physical file.

package pomo
inherited_from \POMO_Reader

 Methods

PHP4 constructor.

POMO_Reader() 
Inherited

PHP4 constructor.

POMO_StringReader($str = ''

Parameters

$str

PHP5 constructor.

__construct($str = ''
inherited_from \POMO_Reader::__construct()

Parameters

$str

PHP5 constructor.

__construct() 
Inherited

close()

close() : true
Inherited

Returns

true

is_resource()

is_resource() : true
Inherited

Returns

true

length()

length() : integer

Returns

integer

pos()

pos() : integer
Inherited

Returns

integer

read()

read(string $bytes) : string

Parameters

$bytes

string

Returns

string

read_all()

read_all() : string

Returns

string

Reads a 32bit Integer from the Stream

readint32() : mixed
Inherited

Returns

mixedThe integer, corresponding to the next 32 bits from the stream of false if there are not enough bytes or on error

Reads an array of 32-bit Integers from the Stream

readint32array(integer $count) : mixed
Inherited

Parameters

$count

integer

How many elements should be read

Returns

mixedArray of integers or false if there isn't enough data or on error

seekto()

seekto(integer $pos) : integer

Parameters

$pos

integer

Returns

integer

Sets the endianness of the file.

setEndian(string $endian) 
Inherited

Parameters

$endian

string

Set the endianness of the file. Accepts 'big', or 'little'.

str_split()

str_split(string $string, integer $chunk_size) : array
Inherited

Parameters

$string

string

$chunk_size

integer

Returns

array

strlen()

strlen(string $string) : integer
Inherited

Parameters

$string

string

Returns

integer

substr()

substr(string $string, integer $start, integer $length) : string
Inherited

Parameters

$string

string

$start

integer

$length

integer

Returns

string

 Properties

 

$_post

$_post 

Default

''
 

$_str

$_str 

Default

''
 

$endian

$endian 

Default

'little'