MoFileParser
in package
Parses file in MO format
Tags
Table of Contents
Constants
- MO_BIG_ENDIAN_MAGIC = 0xde120495
- Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was big endian.
- MO_HEADER_SIZE = 28
- The size of the header of a MO file in bytes.
- MO_LITTLE_ENDIAN_MAGIC = 0x950412de
- Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was little endian.
Methods
- parse() : array<string|int, mixed>
- Parses machine object (MO) format, independent of the machine's endian it was created on. Both 32bit and 64bit systems are supported.
- _readLong() : int
- Reads an unsigned long from stream respecting endianess.
Constants
MO_BIG_ENDIAN_MAGIC
Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was big endian.
public
int
MO_BIG_ENDIAN_MAGIC
= 0xde120495
MO_HEADER_SIZE
The size of the header of a MO file in bytes.
public
int
MO_HEADER_SIZE
= 28
MO_LITTLE_ENDIAN_MAGIC
Magic used for validating the format of a MO file as well as detecting if the machine used to create that file was little endian.
public
int
MO_LITTLE_ENDIAN_MAGIC
= 0x950412de
Methods
parse()
Parses machine object (MO) format, independent of the machine's endian it was created on. Both 32bit and 64bit systems are supported.
public
parse(string $file) : array<string|int, mixed>
Parameters
- $file : string
-
The file to be parsed.
Tags
Return values
array<string|int, mixed> —List of messages extracted from the file
_readLong()
Reads an unsigned long from stream respecting endianess.
protected
_readLong(resource $stream, bool $isBigEndian) : int
Parameters
- $stream : resource
-
The File being read.
- $isBigEndian : bool
-
Whether the current platform is Big Endian