Libraries
LEB128 Source Code
 previous   up   next 

Function Summary
string
getLeb128 (inout file: inFile)
Read a LEB128 encoded number from an inFile.
integer
leb128ToInt (in string: stri, inout integer: pos)
Decode a LEB128 encoded integer from a string.
integer
leb128ToInt (in string: stri)
Decode a LEB128 encoded integer from a string.
integer
uLeb128ToInt (in string: stri, inout integer: pos)
Decode an unsigned LEB128 encoded integer from a string.
integer
uLeb128ToInt (in string: stri)
Decode an unsigned LEB128 encoded integer from a string.
string
leb128 (in var integer: number)
Encode an integer with LEB128 encoding.
string
uLeb128 (in var integer: number)
Encode an integer with unsigned LEB128 encoding.

Function Detail

getLeb128

const func string: getLeb128 (inout file: inFile)

Read a LEB128 encoded number from an inFile.

Parameters:
inFile - File from which the LEB128 encoded number is read.
Returns:
the LEB128 encoded number as string.
Raises:
RANGE_ERROR - If characters beyond '\255;' are present.

leb128ToInt

const func integer: leb128ToInt (in string: stri, inout integer: pos)

Decode a LEB128 encoded integer from a string.

Parameters:
stri - String with an LEB128 encoded integer that starts at position pos.
pos - When the function is called the LEB128 number starts at pos. When the function is left pos refers to the character after the LEB128 number.
Returns:
the decoded LEB128 number.
Raises:
RANGE_ERROR - If characters beyond '\255;' are present.
OVERFLOW_ERROR - If the result value cannot be represented with an integer.

leb128ToInt

const func integer: leb128ToInt (in string: stri)

Decode a LEB128 encoded integer from a string.

Parameters:
stri - String that starts with an LEB128 encoded integer.
Returns:
the decoded LEB128 number.
Raises:
RANGE_ERROR - If characters beyond '\255;' are present.
OVERFLOW_ERROR - If the result value cannot be represented with an integer.

uLeb128ToInt

const func integer: uLeb128ToInt (in string: stri, inout integer: pos)

Decode an unsigned LEB128 encoded integer from a string.

Parameters:
stri - String with an unsigned LEB128 encoded integer that starts at position pos..
pos - When the function is called the LEB128 number starts at pos. When the function is left pos refers to the character after the LEB128 number.
Returns:
the decoded unsigned LEB128 number.
Raises:
RANGE_ERROR - If characters beyond '\255;' are present.
OVERFLOW_ERROR - If the result value cannot be represented with an integer.

uLeb128ToInt

const func integer: uLeb128ToInt (in string: stri)

Decode an unsigned LEB128 encoded integer from a string.

Parameters:
stri - String that starts with an unsigned LEB128 encoded integer.
Returns:
the decoded unsigned LEB128 number.
Raises:
RANGE_ERROR - If characters beyond '\255;' are present.
OVERFLOW_ERROR - If the result value cannot be represented with an integer.

leb128

const func string: leb128 (in var integer: number)

Encode an integer with LEB128 encoding.

Parameters:
number - The number to be encoded.
Returns:
the LEB128 encoded number as string.

uLeb128

const func string: uLeb128 (in var integer: number)

Encode an integer with unsigned LEB128 encoding.

Parameters:
number - The number to be encoded.
Returns:
the unsigned LEB128 encoded number as string.


 previous   up   next