PHP Class Prado\I18N\core\Gettext\TGettext_MO

GNU MO file reader and writer.
Author: Michael Wallner ([email protected])
Inheritance: extends TGettext
Show file Open project: pradosoft/prado Class Usage Examples

Protected Properties

Property Type Description
$_handle resource file handle
$writeBigEndian boolean Whether to write with big endian byte order.

Public Methods

Method Description
__construct ( string $file = '' ) : object Constructor
_read ( integer $bytes = 1 ) : mixed _read
_readInt ( boolean $bigendian = false ) : integer _readInt
_readStr ( array $params ) : string _readStr
_write ( string $data ) : integer _write
_writeInt ( integer $int ) : integer _writeInt
_writeStr ( string $string ) : integer _writeStr
load ( string $file = null ) : mixed Load MO file
save ( string $file = null ) : mixed Save MO file

Method Details

__construct() public method

Constructor
public __construct ( string $file = '' ) : object
$file string path to GNU MO file
return object File_Gettext_MO

_read() public method

_read
public _read ( integer $bytes = 1 ) : mixed
$bytes integer
return mixed

_readInt() public method

_readInt
public _readInt ( boolean $bigendian = false ) : integer
$bigendian boolean
return integer

_readStr() public method

_readStr
public _readStr ( array $params ) : string
$params array associative array with offset and length of the string
return string

_write() public method

_write
public _write ( string $data ) : integer
$data string
return integer

_writeInt() public method

_writeInt
public _writeInt ( integer $int ) : integer
$int integer
return integer

_writeStr() public method

_writeStr
public _writeStr ( string $string ) : integer
$string string
return integer

load() public method

Load MO file
public load ( string $file = null ) : mixed
$file string
return mixed Returns true on success or PEAR_Error on failure.

save() public method

Save MO file
public save ( string $file = null ) : mixed
$file string
return mixed Returns true on success or PEAR_Error on failure.

Property Details

$_handle protected property

file handle
protected resource $_handle
return resource

$writeBigEndian protected property

Whether to write with big endian byte order.
protected bool $writeBigEndian
return boolean