\ESLKem\GBXParserParser

The primary parser class for GBX parsing

This class holds one public Parser::parse() methods which calls internal byte reading methods and reads primitives into a Map (or GBX, if unrecognized) object.

Summary

Methods
Properties
Constants
parse()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
readTmDesc()
readCommon()
readCommunity()
readThumbnail()
readAuthor()
fetchBytes()
fetchUInt8()
fetchUInt16()
fetchUInt32()
fetchUInt64()
fetchFloat()
fetchBool()
fetchString()
fetchLookbackString()
fetchMeta()
No private properties found
N/A

Methods

parse()

parse(string  $filename) : \ESLKem\GBXParser\Models\GBX

The parsing function which reads the specified file and returns the parsed result, temporarilly all the data is stored in a simple array

Parameters

string $filename

A string containing the GBX file location

Returns

\ESLKem\GBXParser\Models\GBX

A GBX (or any subclass) object contaning the parsed information

readTmDesc()

readTmDesc(resource  $fileHandle, array  $properties) 

Reads the TmDesc chunk of GBX

Parameters

resource $fileHandle

A stream for the opened file

array $properties

A reference to the temporary property array

readCommon()

readCommon(resource  $fileHandle, array  $properties) 

Reads the Common chunk of GBX

Parameters

resource $fileHandle

A stream for the opened file

array $properties

A reference to the temporary property array

readCommunity()

readCommunity(resource  $fileHandle, array  $properties) 

Reads the Community chunk of GBX

Parameters

resource $fileHandle

A stream for the opened file

array $properties

A reference to the temporary property array

readThumbnail()

readThumbnail(resource  $fileHandle, array  $properties) 

Reads the Thumbnail chunk of GBX

Parameters

resource $fileHandle

A stream for the opened file

array $properties

A reference to the temporary property array

readAuthor()

readAuthor(resource  $fileHandle, array  $properties) 

Reads the Author chunk of GBX

Parameters

resource $fileHandle

A stream for the opened file

array $properties

A reference to the temporary property array

fetchBytes()

fetchBytes(resource  $handle, integer  $numBytes = 1) : string

Fetches a specified number of bytes from the data stream

Parameters

resource $handle

A stream for the opened file

integer $numBytes

The number of bytes to read

Returns

string —

The read bytes represented by a string

fetchUInt8()

fetchUInt8(resource  $handle) : integer

Fetches an 8-bit unsigned integer from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

integer —

The read integer

fetchUInt16()

fetchUInt16(resource  $handle) : integer

Fetches a 16-bit unsigned integer from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

integer —

The read integer

fetchUInt32()

fetchUInt32(resource  $handle) : integer

Fetches a 32-bit unsigned integer from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

integer —

The read integer

fetchUInt64()

fetchUInt64(resource  $handle) : integer

Fetches a 64-bit unsigned integer from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

integer —

The read integer

fetchFloat()

fetchFloat(resource  $handle) : float

Fetches a 32-bit floating point number from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

float —

The read float

fetchBool()

fetchBool(resource  $handle) : boolean

Fetches a 32-bit boolean from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

boolean —

The read boolean

fetchString()

fetchString(resource  $handle) : string

Fetches a string from the data stream

Parameters

resource $handle

A stream for the opened file

Returns

string —

The read integer

fetchLookbackString()

fetchLookbackString(resource  $handle, array  $lookbackStrings) : string

Fetches a lookbackstring from the data stream

Parameters

resource $handle

A stream for the opened file

array $lookbackStrings

A reference to the lookbackstring array used for the chunk being read

Returns

string —

The read string

fetchMeta()

fetchMeta(resource  $handle, array  $lookbackStrings) : array

Fetches a meta structure from the data stream

Parameters

resource $handle

A stream for the opened file

array $lookbackStrings

A reference to the lookbackstring array used for the chunk being read

Returns

array —

The read array of three strings