UTF8ToString ⇒ string
⏏
Reads a null-terminated string from the Emscripten heap.
Kind: Exported member
Returns: string
- The string.
See: https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString
Param | Type | Description |
---|---|---|
ptr | number | The pointer to the string. |
Example
const wkt = geos.Module.UTF8ToString(wktPtr)
_malloc ⇒ number
⏏
Allocates memory on the Emscripten heap.
Kind: Exported member
Returns: number
- The pointer to the allocated memory.
See: https://emscripten.org/docs/api_reference/preamble.js.html#_malloc
Param | Type | Description |
---|---|---|
size | number | The size of the memory to allocate. |
Example
const wktPtr = geos.Module._malloc(wkt.length + 1)
getValue ⇒ number
⏏
Reads a value from the Emscripten heap.
Kind: Exported member
Returns: number
- The value.
See: https://emscripten.org/docs/api_reference/preamble.js.html#getValue
Param | Type | Description |
---|---|---|
ptr | number | The pointer to the value. |
type | string | The type of the value. |
Example
const area = geos.Module.getValue(areaPtr, 'double')
console.log(area) // area = 1
setValue ⏏
Writes a value to the Emscripten heap.
Kind: Exported member
See: https://emscripten.org/docs/api_reference/preamble.js.html#setValue
Param | Type | Description |
---|---|---|
ptr | number | The pointer to the value. |
type | string | The type of the value. |
value | number | The value. |
Example
geos.Module.setValue(areaPtr, 'double', 0)
stringToUTF8 ⏏
Writes a string to the Emscripten heap.
Kind: Exported member
See: https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8
Param | Type | Description |
---|---|---|
str | string | The string. |
ptr | number | The pointer to the string. |
[maxLength] | number | The maximum length of the string. |
Example
geos.Module.stringToUTF8(wkt, wktPtr)