Data Fields

struct PP_Var(* Create )(void)
struct PP_Var(* Get )(struct PP_Var array, uint32_t index)
PP_Bool(* Set )(struct PP_Var array, uint32_t index, struct PP_Var value)
uint32_t(* GetLength )(struct PP_Var array)
PP_Bool(* SetLength )(struct PP_Var array, uint32_t length)

Field Documentation

struct PP_Var(* PPB_VarArray::Create)(void) [read]

Creates an array var, i.e., a PP_Var with type set to PP_VARTYPE_ARRAY.

The array length is set to 0.

Returns:
An empty array var, whose reference count is set to 1 on behalf of the caller.
struct PP_Var(* PPB_VarArray::Get)(struct PP_Var array, uint32_t index) [read]

Gets an element from the array.

Parameters:
[in]arrayAn array var.
[in]indexAn index indicating which element to return.
Returns:
The element at the specified position. The reference count of the element returned is incremented on behalf of the caller. If index is larger than or equal to the array length, an undefined var is returned.
uint32_t(* PPB_VarArray::GetLength)(struct PP_Var array)

Gets the array length.

Parameters:
[in]arrayAn array var.
Returns:
The array length.
PP_Bool(* PPB_VarArray::Set)(struct PP_Var array, uint32_t index, struct PP_Var value)

Sets the value of an element in the array.

Parameters:
[in]arrayAn array var.
[in]indexAn index indicating which element to modify. If index is larger than or equal to the array length, the length is updated to be index + 1. Any position in the array that hasn't been set before is set to undefined, i.e., PP_Var of type PP_VARTYPE_UNDEFINED.
[in]valueThe value to set. The array holds a reference to it on success.
Returns:
A PP_Bool indicating whether the operation succeeds.
PP_Bool(* PPB_VarArray::SetLength)(struct PP_Var array, uint32_t length)

Sets the array length.

Parameters:
[in]arrayAn array var.
[in]lengthThe new array length. If length is smaller than its current value, the array is truncated to the new length; any elements that no longer fit are removed and the references to them will be released. If length is larger than its current value, undefined vars are appended to increase the array to the specified length.
Returns:
A PP_Bool indicating whether the operation succeeds.

The documentation for this struct was generated from the following file:
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.