classpp_1_1_var_dictionary.html revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1{{+bindTo:partials.standard_nacl_article}} 2<h1>pp::VarDictionary Class Reference</h1> 3<div id="doxygen-ref"> 4{{- dummy div to appease doxygen -}} 5 <div> 6<!-- Generated by Doxygen 1.7.6.1 --> 7 8 9 10</div> 11<!--header--> 12<div class="contents"> 13<!-- doxytag: class="pp::VarDictionary" --><!-- doxytag: inherits="pp::Var" --><div class="dynheader"> 14Inheritance diagram for pp::VarDictionary:</div> 15<div class="dyncontent"> 16<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> 17<map name="pp_1_1_var_dictionary_inherit__map" id="pp_1_1_var_dictionary_inherit__map"> 18<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="37,5,104,35"></area></map> 19<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> 20<p><a href="classpp_1_1_var_dictionary-members.html">List of all members.</a></p> 21<h2> 22Public Member Functions</h2><table class="memberdecls"> 23 24<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">VarDictionary</a> ()</td></tr> 25<tr><td class="memItemLeft" align="right" valign="top"> </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> &var)</td></tr> 26<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#aaca1887754d80b56503cd0c329397f74">VarDictionary</a> (const PP_Var &var)</td></tr> 27<tr><td class="memItemLeft" align="right" valign="top"> </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> &other)</td></tr> 28<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#adc8bdb1aee0e5deaee3b88a755cbc9ff">~VarDictionary</a> ()</td></tr> 29<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> & </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> &other)</td></tr> 30<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classpp_1_1_var.html">Var</a> & </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> &other)</td></tr> 31<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var.html">Var</a> </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> &key) const </td></tr> 32<tr><td class="memItemLeft" align="right" valign="top">bool </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> &key, const <a class="el" href="classpp_1_1_var.html">Var</a> &value)</td></tr> 33<tr><td class="memItemLeft" align="right" valign="top">void </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> &key)</td></tr> 34<tr><td class="memItemLeft" align="right" valign="top">bool </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> &key) const </td></tr> 35<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var_array.html">VarArray</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_dictionary.html#a90073effa08ca9664e357027ba4c8c48">GetKeys</a> () const </td></tr> 36</table> 37<hr /><h2>Constructor & Destructor Documentation</h2> 38<a class="anchor" id="a8687ca12c7d53653e7ea164ca13c86f8"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="a8687ca12c7d53653e7ea164ca13c86f8" args="()" --> 39<div class="memitem"> 40<div class="memproto"> 41<table class="memname"> 42<tr> 43<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td> 44<td>(</td> 45<td class="paramname"></td><td>)</td> 46<td></td> 47</tr> 48</table> 49</div> 50<div class="memdoc"> 51<p>Constructs a new dictionary var. </p> 52</div> 53</div> 54<a class="anchor" id="ae90f19faf752428dce18ab319a421aa7"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="ae90f19faf752428dce18ab319a421aa7" args="(const Var &var)" --> 55<div class="memitem"> 56<div class="memproto"> 57<table class="memname"> 58<tr> 59<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td> 60<td>(</td> 61<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 62<td class="paramname"><em>var</em></td><td>)</td> 63<td><code> [explicit]</code></td> 64</tr> 65</table> 66</div> 67<div class="memdoc"> 68<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> 69<p>This will refer to the same dictionary var, but allow you to access methods specific to dictionary.</p> 70<dl class="params"><dt><b>Parameters:</b></dt><dd> 71<table class="params"> 72<tr><td class="paramdir">[in]</td><td class="paramname">var</td><td>A dictionary var. </td></tr> 73</table> 74</dd> 75</dl> 76</div> 77</div> 78<a class="anchor" id="aaca1887754d80b56503cd0c329397f74"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="aaca1887754d80b56503cd0c329397f74" args="(const PP_Var &var)" --> 79<div class="memitem"> 80<div class="memproto"> 81<table class="memname"> 82<tr> 83<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td> 84<td>(</td> 85<td class="paramtype">const PP_Var & </td> 86<td class="paramname"><em>var</em></td><td>)</td> 87<td><code> [explicit]</code></td> 88</tr> 89</table> 90</div> 91<div class="memdoc"> 92<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> 93<dl class="params"><dt><b>Parameters:</b></dt><dd> 94<table class="params"> 95<tr><td class="paramdir">[in]</td><td class="paramname">var</td><td>A <code>PP_Var</code> of type PP_VARTYPE_DICTIONARY. </td></tr> 96</table> 97</dd> 98</dl> 99</div> 100</div> 101<a class="anchor" id="a42546bb501a2e5d74f1092e88cf162ac"></a><!-- doxytag: member="pp::VarDictionary::VarDictionary" ref="a42546bb501a2e5d74f1092e88cf162ac" args="(const VarDictionary &other)" --> 102<div class="memitem"> 103<div class="memproto"> 104<table class="memname"> 105<tr> 106<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html#a8687ca12c7d53653e7ea164ca13c86f8">pp::VarDictionary::VarDictionary</a> </td> 107<td>(</td> 108<td class="paramtype">const <a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> & </td> 109<td class="paramname"><em>other</em></td><td>)</td> 110<td></td> 111</tr> 112</table> 113</div> 114<div class="memdoc"> 115<p>Copy constructor. </p> 116</div> 117</div> 118<a class="anchor" id="adc8bdb1aee0e5deaee3b88a755cbc9ff"></a><!-- doxytag: member="pp::VarDictionary::~VarDictionary" ref="adc8bdb1aee0e5deaee3b88a755cbc9ff" args="()" --> 119<div class="memitem"> 120<div class="memproto"> 121<table class="memname"> 122<tr> 123<td class="memname">virtual <a class="el" href="classpp_1_1_var_dictionary.html#adc8bdb1aee0e5deaee3b88a755cbc9ff">pp::VarDictionary::~VarDictionary</a> </td> 124<td>(</td> 125<td class="paramname"></td><td>)</td> 126<td><code> [virtual]</code></td> 127</tr> 128</table> 129</div> 130<div class="memdoc"> 131</div> 132</div> 133<hr /><h2>Member Function Documentation</h2> 134<a class="anchor" id="a1a3c22688159becedcb855fa78619c8c"></a><!-- doxytag: member="pp::VarDictionary::Delete" ref="a1a3c22688159becedcb855fa78619c8c" args="(const Var &key)" --> 135<div class="memitem"> 136<div class="memproto"> 137<table class="memname"> 138<tr> 139<td class="memname">void <a class="el" href="classpp_1_1_var_dictionary.html#a1a3c22688159becedcb855fa78619c8c">pp::VarDictionary::Delete</a> </td> 140<td>(</td> 141<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 142<td class="paramname"><em>key</em></td><td>)</td> 143<td></td> 144</tr> 145</table> 146</div> 147<div class="memdoc"> 148<p>Deletes the specified key and its associated value, if the key exists. </p> 149<dl class="params"><dt><b>Parameters:</b></dt><dd> 150<table class="params"> 151<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var. </td></tr> 152</table> 153</dd> 154</dl> 155</div> 156</div> 157<a class="anchor" id="a2221719e6c6f35e4333f426f8366451b"></a><!-- doxytag: member="pp::VarDictionary::Get" ref="a2221719e6c6f35e4333f426f8366451b" args="(const Var &key) const " --> 158<div class="memitem"> 159<div class="memproto"> 160<table class="memname"> 161<tr> 162<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> 163<td>(</td> 164<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 165<td class="paramname"><em>key</em></td><td>)</td> 166<td> const</td> 167</tr> 168</table> 169</div> 170<div class="memdoc"> 171<p>Gets the value associated with the specified key. </p> 172<dl class="params"><dt><b>Parameters:</b></dt><dd> 173<table class="params"> 174<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var.</td></tr> 175</table> 176</dd> 177</dl> 178<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> 179</div> 180</div> 181<a class="anchor" id="a90073effa08ca9664e357027ba4c8c48"></a><!-- doxytag: member="pp::VarDictionary::GetKeys" ref="a90073effa08ca9664e357027ba4c8c48" args="() const " --> 182<div class="memitem"> 183<div class="memproto"> 184<table class="memname"> 185<tr> 186<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> 187<td>(</td> 188<td class="paramname"></td><td>)</td> 189<td> const</td> 190</tr> 191</table> 192</div> 193<div class="memdoc"> 194<p>Gets all the keys in the dictionary. </p> 195<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> 196</div> 197</div> 198<a class="anchor" id="a3fd937b874ff4c5361e5b0e21829bd6a"></a><!-- doxytag: member="pp::VarDictionary::HasKey" ref="a3fd937b874ff4c5361e5b0e21829bd6a" args="(const Var &key) const " --> 199<div class="memitem"> 200<div class="memproto"> 201<table class="memname"> 202<tr> 203<td class="memname">bool <a class="el" href="classpp_1_1_var_dictionary.html#a3fd937b874ff4c5361e5b0e21829bd6a">pp::VarDictionary::HasKey</a> </td> 204<td>(</td> 205<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 206<td class="paramname"><em>key</em></td><td>)</td> 207<td> const</td> 208</tr> 209</table> 210</div> 211<div class="memdoc"> 212<p>Checks whether a key exists. </p> 213<dl class="params"><dt><b>Parameters:</b></dt><dd> 214<table class="params"> 215<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>A string var.</td></tr> 216</table> 217</dd> 218</dl> 219<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>bool</code> indicating whether the key exists. </dd></dl> 220</div> 221</div> 222<a class="anchor" id="a0fc59e6a9751d35815e0bfa4a0d06217"></a><!-- doxytag: member="pp::VarDictionary::operator=" ref="a0fc59e6a9751d35815e0bfa4a0d06217" args="(const VarDictionary &other)" --> 223<div class="memitem"> 224<div class="memproto"> 225<table class="memname"> 226<tr> 227<td class="memname"><a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a>& pp::VarDictionary::operator= </td> 228<td>(</td> 229<td class="paramtype">const <a class="el" href="classpp_1_1_var_dictionary.html">VarDictionary</a> & </td> 230<td class="paramname"><em>other</em></td><td>)</td> 231<td></td> 232</tr> 233</table> 234</div> 235<div class="memdoc"> 236<p>Assignment operator. </p> 237</div> 238</div> 239<a class="anchor" id="a689815e0b4e50e2f1e9aaa8b1ef34e00"></a><!-- doxytag: member="pp::VarDictionary::operator=" ref="a689815e0b4e50e2f1e9aaa8b1ef34e00" args="(const Var &other)" --> 240<div class="memitem"> 241<div class="memproto"> 242<table class="memname"> 243<tr> 244<td class="memname">virtual <a class="el" href="classpp_1_1_var.html">Var</a>& pp::VarDictionary::operator= </td> 245<td>(</td> 246<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 247<td class="paramname"><em>other</em></td><td>)</td> 248<td><code> [virtual]</code></td> 249</tr> 250</table> 251</div> 252<div class="memdoc"> 253<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> 254<dl class="params"><dt><b>Parameters:</b></dt><dd> 255<table class="params"> 256<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>The dictionary var to be assigned.</td></tr> 257</table> 258</dd> 259</dl> 260<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>&). </dd></dl> 261<p>Reimplemented from <a class="el" href="classpp_1_1_var.html#a65601024610f1625c9945acb8725d7c4">pp::Var</a>.</p> 262</div> 263</div> 264<a class="anchor" id="a5655feba6620abf7654d008e245971d8"></a><!-- doxytag: member="pp::VarDictionary::Set" ref="a5655feba6620abf7654d008e245971d8" args="(const Var &key, const Var &value)" --> 265<div class="memitem"> 266<div class="memproto"> 267<table class="memname"> 268<tr> 269<td class="memname">bool <a class="el" href="classpp_1_1_var_dictionary.html#a5655feba6620abf7654d008e245971d8">pp::VarDictionary::Set</a> </td> 270<td>(</td> 271<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 272<td class="paramname"><em>key</em>, </td> 273</tr> 274<tr> 275<td class="paramkey"></td> 276<td></td> 277<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> & </td> 278<td class="paramname"><em>value</em> </td> 279</tr> 280<tr> 281<td></td> 282<td>)</td> 283<td></td><td></td> 284</tr> 285</table> 286</div> 287<div class="memdoc"> 288<p>Sets the value associated with the specified key. </p> 289<dl class="params"><dt><b>Parameters:</b></dt><dd> 290<table class="params"> 291<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> 292<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to set.</td></tr> 293</table> 294</dd> 295</dl> 296<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>bool</code> indicating whether the operation succeeds. </dd></dl> 297</div> 298</div> 299<hr />The documentation for this class was generated from the following file:<ul> 300<li><a class="el" href="var__dictionary_8h.html">var_dictionary.h</a></li> 301</ul> 302</div><!-- contents --> 303</div> 304{{/partials.standard_nacl_article}} 305