blob: ddbf3e376d5359196bce70ccfa46b5a20b34b9f4 [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_VarArray Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_VarArray" --><h2>
Data Fields</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___var_array__1__0.html#af70ca94305325f09306058ec87f50ca5">Create</a> )(void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___var_array__1__0.html#a20431bfeea806a1af61d4cca2f1f1437">Get</a> )(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array, uint32_t index)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___var_array__1__0.html#aea60f6d4917fa248237c6bfd1eda92fe">Set</a> )(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array, uint32_t index, struct <a class="el" href="struct_p_p___var.html">PP_Var</a> value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___var_array__1__0.html#ab1163119c730c95fea571a4618b8cc8f">GetLength</a> )(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___var_array__1__0.html#a4868611700bcca797bfae701870ce83b">SetLength</a> )(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array, uint32_t length)</td></tr>
</table>
<hr /><h2>Field Documentation</h2>
<a class="anchor" id="af70ca94305325f09306058ec87f50ca5"></a><!-- doxytag: member="PPB_VarArray::Create" ref="af70ca94305325f09306058ec87f50ca5" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* <a class="el" href="struct_p_p_b___var_array__1__0.html#af70ca94305325f09306058ec87f50ca5">PPB_VarArray::Create</a>)(void)<code> [read]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates an array var, i.e., a <code><a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a></code> with type set to <code>PP_VARTYPE_ARRAY</code>. </p>
<p>The array length is set to 0.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An empty array var, whose reference count is set to 1 on behalf of the caller. </dd></dl>
</div>
</div>
<a class="anchor" id="a20431bfeea806a1af61d4cca2f1f1437"></a><!-- doxytag: member="PPB_VarArray::Get" ref="a20431bfeea806a1af61d4cca2f1f1437" args=")(struct PP_Var array, uint32_t index)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* <a class="el" href="struct_p_p_b___var_array__1__0.html#a20431bfeea806a1af61d4cca2f1f1437">PPB_VarArray::Get</a>)(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array, uint32_t index)<code> [read]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets an element from the array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">array</td><td>An array var. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An index indicating which element to return.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The element at the specified position. The reference count of the element returned is incremented on behalf of the caller. If <code>index</code> is larger than or equal to the array length, an undefined var is returned. </dd></dl>
</div>
</div>
<a class="anchor" id="ab1163119c730c95fea571a4618b8cc8f"></a><!-- doxytag: member="PPB_VarArray::GetLength" ref="ab1163119c730c95fea571a4618b8cc8f" args=")(struct PP_Var array)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t(* <a class="el" href="struct_p_p_b___var_array__1__0.html#ab1163119c730c95fea571a4618b8cc8f">PPB_VarArray::GetLength</a>)(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the array length. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">array</td><td>An array var.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The array length. </dd></dl>
</div>
</div>
<a class="anchor" id="aea60f6d4917fa248237c6bfd1eda92fe"></a><!-- doxytag: member="PPB_VarArray::Set" ref="aea60f6d4917fa248237c6bfd1eda92fe" args=")(struct PP_Var array, uint32_t index, struct PP_Var value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___var_array__1__0.html#aea60f6d4917fa248237c6bfd1eda92fe">PPB_VarArray::Set</a>)(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array, uint32_t index, struct <a class="el" href="struct_p_p___var.html">PP_Var</a> value)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the value of an element in the array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">array</td><td>An array var. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An index indicating which element to modify. If <code>index</code> is larger than or equal to the array length, the length is updated to be <code>index</code> + 1. Any position in the array that hasn't been set before is set to undefined, i.e., <code><a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a></code> of type <code>PP_VARTYPE_UNDEFINED</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to set. The array holds a reference to it on success.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> indicating whether the operation succeeds. </dd></dl>
</div>
</div>
<a class="anchor" id="a4868611700bcca797bfae701870ce83b"></a><!-- doxytag: member="PPB_VarArray::SetLength" ref="a4868611700bcca797bfae701870ce83b" args=")(struct PP_Var array, uint32_t length)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___var_array__1__0.html#a4868611700bcca797bfae701870ce83b">PPB_VarArray::SetLength</a>)(struct <a class="el" href="struct_p_p___var.html">PP_Var</a> array, uint32_t length)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the array length. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">array</td><td>An array var. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>The new array length. If <code>length</code> 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 <code>length</code> is larger than its current value, undefined vars are appended to increase the array to the specified length.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> indicating whether the operation succeeds. </dd></dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__var__array_8h.html">ppb_var_array.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}