Sgss_File_Reader_String
Reads bytes from string

Description

Class diagram:
Sgss_File_Reader_Abstract
 + Sgss_File_Reader_String
Used by:
Sgss_Font_Parser_Abstract::getBlockReader()
Author:
Matsuda Shota
Copyright:
(c) 2007-2008 Matsuda Shota
Usedby:
Sgss_Font_Parser_Abstract::getBlockReader()
License:
http://creativecommons.org/licenses/GPL/2.0/
Located in:
/File/Reader/String.php (line 51)

Class overview

Variable

protected string $_string

String to read

Inherited from Sgss_File_Reader_Abstract:
Sgss_File_Reader_Abstract::$_position, Sgss_File_Reader_Abstract::$_size

Methods

__construct (string $string)

The constructor

boolean close ()

Unsets the string

string read ([int $length = 1], int $lengthw)

Reads the contents and moves the pointer of the string by the specified length of bytes

string readAll ()

Returns the string being readed

int reset ()

Moves the pointer of the string to the first

Inherited from Sgss_File_Reader_Abstract:
filter(), move(), position(), size(), skip()

Variable detail

$_string 

String to read

Signature:
protected string $_string


Method detail

__construct

The constructor

Parameters:
  • string $string

    String to read

Signature:
public __construct (string $string)


close

Unsets the string

Returns:
boolean -- Always true
Related subject:
Sgss_File_Reader_Interface::close()
Signature:
public boolean close ()


read

Reads the contents and moves the pointer of the string by the specified length of bytes

Parameters:
  • int $lengthw

    Length in byte to read

  • $length
Returns:
string -- Retrieved byte string
Throws:
  • Sgss_File_Reader_Exception

    When attempting to read beyond the end of string

Related subject:
Sgss_File_Reader_Interface::read()
Signature:
public string read ([int $length = 1], int $lengthw)


readAll

Returns the string being readed

Returns:
string -- String being readed
Related subject:
Sgss_File_Reader_Interface::readAll()
Signature:
public string readAll ()


reset

Moves the pointer of the string to the first

Returns:
int -- Offset length in byte, from the previous position to the position after this operation
Uses:
Sgss_File_Reader_Abstract::move()
Related subject:
Sgss_File_Reader_Interface::reset()
Signature:
public int reset ()