chromium/native_client_sdk/doc_generated/pepper_dev/cpp/classpp_1_1_var_dictionary.html

{{+bindTo:partials.standard_nacl_api}}
<h1>pp::VarDictionary Class 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="pp::VarDictionary" --><!-- doxytag: inherits="pp::Var" --><div class="dynheader">
Inheritance diagram for pp::VarDictionary:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_var_dictionary__inherit__graph.png" border="0" usemap="#pp_1_1_var_dictionary_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_var_dictionary_inherit__map" id="pp_1_1_var_dictionary_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page." alt="" coords="36,5,103,32"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_var_dictionary-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">VarDictionary</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#ae90f19faf752428dce18ab319a421aa7">VarDictionary</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;var)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#aaca1887754d80b56503cd0c329397f74">VarDictionary</a> (const PP_Var &amp;var)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a42546bb501a2e5d74f1092e88cf162ac">VarDictionary</a> (const <a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#adc8bdb1aee0e5deaee3b88a755cbc9ff">~VarDictionary</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a0fc59e6a9751d35815e0bfa4a0d06217">operator=</a> (const <a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a689815e0b4e50e2f1e9aaa8b1ef34e00">operator=</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var.html">Var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a2221719e6c6f35e4333f426f8366451b">Get</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;key) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a5655feba6620abf7654d008e245971d8">Set</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;key, const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a1a3c22688159becedcb855fa78619c8c">Delete</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;key)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a3fd937b874ff4c5361e5b0e21829bd6a">HasKey</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;key) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var_array.html">VarArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a90073effa08ca9664e357027ba4c8c48">GetKeys</a> () const </td></tr>
</table>
<hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a8687ca12c7d53653e7ea164ca13c86f8"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="a8687ca12c7d53653e7ea164ca13c86f8" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new dictionary var. </p>
</div>
</div>
<a class="anchor" id="ae90f19faf752428dce18ab319a421aa7"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="ae90f19faf752428dce18ab319a421aa7" args="(const Var &amp;var)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>var</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <code><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a></code> given a var for which <a class="el" href="classpp_1_1_var.html#ae061050e5deaac345eb089b9cd8796ea" title="This function determines if this Var is a dictionary.">is_dictionary()</a> is true. </p>
<p>This will refer to the same dictionary var, but allow you to access methods specific to dictionary.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">var</td><td>A dictionary var. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aaca1887754d80b56503cd0c329397f74"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="aaca1887754d80b56503cd0c329397f74" args="(const PP_Var &amp;var)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td>
<td>(</td>
<td class="paramtype">const PP_Var &amp;&#160;</td>
<td class="paramname"><em>var</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <code><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a></code> given a <code>PP_Var</code> of type PP_VARTYPE_DICTIONARY. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">var</td><td>A <code>PP_Var</code> of type PP_VARTYPE_DICTIONARY. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a42546bb501a2e5d74f1092e88cf162ac"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="a42546bb501a2e5d74f1092e88cf162ac" args="(const VarDictionary &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Copy constructor. </p>
</div>
</div>
<a class="anchor" id="adc8bdb1aee0e5deaee3b88a755cbc9ff"></a><!-- doxytag: member="pp::VarDictionary::~VarDictionary" ref="adc8bdb1aee0e5deaee3b88a755cbc9ff" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classpp_1_1_var_dictionary.html#adc8bdb1aee0e5deaee3b88a755cbc9ff">pp::VarDictionary::~VarDictionary</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="a1a3c22688159becedcb855fa78619c8c"></a><!-- doxytag: member="pp::VarDictionary::Delete" ref="a1a3c22688159becedcb855fa78619c8c" args="(const Var &amp;key)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classpp_1_1_var_dictionary.html#a1a3c22688159becedcb855fa78619c8c">pp::VarDictionary::Delete</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deletes the specified key and its associated value, if the key exists. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a2221719e6c6f35e4333f426f8366451b"></a><!-- doxytag: member="pp::VarDictionary::Get" ref="a2221719e6c6f35e4333f426f8366451b" args="(const Var &amp;key) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var.html">Var</a> <a class="el" href="classpp_1_1_var_dictionary.html#a2221719e6c6f35e4333f426f8366451b">pp::VarDictionary::Get</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the value associated with the specified key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The value that is associated with <code>key</code>. If <code>key</code> is not a string var, or it doesn't exist in the dictionary, an undefined var is returned. </dd></dl>
</div>
</div>
<a class="anchor" id="a90073effa08ca9664e357027ba4c8c48"></a><!-- doxytag: member="pp::VarDictionary::GetKeys" ref="a90073effa08ca9664e357027ba4c8c48" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_array.html">VarArray</a> <a class="el" href="classpp_1_1_var_dictionary.html#a90073effa08ca9664e357027ba4c8c48">pp::VarDictionary::GetKeys</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets all the keys in the dictionary. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An array var which contains all the keys of the dictionary. The elements are string vars. Returns an empty array var if failed. </dd></dl>
</div>
</div>
<a class="anchor" id="a3fd937b874ff4c5361e5b0e21829bd6a"></a><!-- doxytag: member="pp::VarDictionary::HasKey" ref="a3fd937b874ff4c5361e5b0e21829bd6a" args="(const Var &amp;key) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_var_dictionary.html#a3fd937b874ff4c5361e5b0e21829bd6a">pp::VarDictionary::HasKey</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks whether a key exists. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>bool</code> indicating whether the key exists. </dd></dl>
</div>
</div>
<a class="anchor" id="a0fc59e6a9751d35815e0bfa4a0d06217"></a><!-- doxytag: member="pp::VarDictionary::operator=" ref="a0fc59e6a9751d35815e0bfa4a0d06217" args="(const VarDictionary &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a>&amp; pp::VarDictionary::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Assignment operator. </p>
</div>
</div>
<a class="anchor" id="a689815e0b4e50e2f1e9aaa8b1ef34e00"></a><!-- doxytag: member="pp::VarDictionary::operator=" ref="a689815e0b4e50e2f1e9aaa8b1ef34e00" args="(const Var &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classpp_1_1_var.html">Var</a>&amp; pp::VarDictionary::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> assignment operator is overridden here so that we can check for assigning a non-dictionary var to a <code><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a></code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>The dictionary var to be assigned.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The resulting <code><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a></code> (as a <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code>&amp;). </dd></dl>
<p>Reimplemented from <a class="el" href="classpp_1_1_var.html#a65601024610f1625c9945acb8725d7c4">pp::Var</a>.</p>
</div>
</div>
<a class="anchor" id="a5655feba6620abf7654d008e245971d8"></a><!-- doxytag: member="pp::VarDictionary::Set" ref="a5655feba6620abf7654d008e245971d8" args="(const Var &amp;key, const Var &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_var_dictionary.html#a5655feba6620abf7654d008e245971d8">pp::VarDictionary::Set</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the value associated with the specified key. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var. If this key hasn't existed in the dictionary, it is added and associated with <code>value</code>; otherwise, the previous value is replaced with <code>value</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to set.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>bool</code> indicating whether the operation succeeds. </dd></dl>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="var__dictionary_8h.html">var_dictionary.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}