/xbmc/visualizations/Vortex/angelscript/docs/manual/doc_addon_dict.html
http://github.com/xbmc/xbmc · HTML · 80 lines · 73 code · 6 blank · 1 comment · 0 complexity · 9dbccdc77da523fd99dbff34d5fdcd83 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
- <title>AngelScript: dictionary object</title>
- <link href="tabs.css" rel="stylesheet" type="text/css">
- <link href="doxygen.css" rel="stylesheet" type="text/css">
- </head><body>
- <!-- Generated by Doxygen 1.5.9 -->
- <div class="contents">
- <h1><a class="anchor" name="doc_addon_dict">dictionary object </a></h1><b>Path:</b> /sdk/add_on/scriptdictionary/<p>
- The dictionary object maps string values to values or objects of other types.<p>
- Register with <code>RegisterScriptDictionary(asIScriptEngine*)</code>.<h2><a class="anchor" name="doc_addon_dict_1">
- Public C++ interface</a></h2>
- <div class="fragment"><pre class="fragment"><span class="keyword">class </span>CScriptDictionary
- {
- <span class="keyword">public</span>:
- <span class="comment">// Memory management</span>
- CScriptDictionary(<a class="code" href="classas_i_script_engine.html" title="The engine interface.">asIScriptEngine</a> *engine);
- <span class="keywordtype">void</span> AddRef();
- <span class="keywordtype">void</span> Release();
- <span class="comment">// Sets/Gets a variable type value for a key</span>
- <span class="keywordtype">void</span> Set(<span class="keyword">const</span> std::string &key, <span class="keywordtype">void</span> *value, <span class="keywordtype">int</span> typeId);
- <span class="keywordtype">bool</span> Get(<span class="keyword">const</span> std::string &key, <span class="keywordtype">void</span> *value, <span class="keywordtype">int</span> typeId) <span class="keyword">const</span>;
- <span class="comment">// Sets/Gets an integer number value for a key</span>
- <span class="keywordtype">void</span> Set(<span class="keyword">const</span> std::string &key, <a class="code" href="angelscript_8h.html#a8044b56ee56e2350b06f1e7207b43df" title="64 bit integer">asINT64</a> &value);
- <span class="keywordtype">bool</span> Get(<span class="keyword">const</span> std::string &key, <a class="code" href="angelscript_8h.html#a8044b56ee56e2350b06f1e7207b43df" title="64 bit integer">asINT64</a> &value) <span class="keyword">const</span>;
- <span class="comment">// Sets/Gets a real number value for a key</span>
- <span class="keywordtype">void</span> Set(<span class="keyword">const</span> std::string &key, <span class="keywordtype">double</span> &value);
- <span class="keywordtype">bool</span> Get(<span class="keyword">const</span> std::string &key, <span class="keywordtype">double</span> &value) <span class="keyword">const</span>;
- <span class="comment">// Returns true if the key is set</span>
- <span class="keywordtype">bool</span> Exists(<span class="keyword">const</span> std::string &key) <span class="keyword">const</span>;
-
- <span class="comment">// Deletes the key</span>
- <span class="keywordtype">void</span> Delete(<span class="keyword">const</span> std::string &key);
-
- <span class="comment">// Deletes all keys</span>
- <span class="keywordtype">void</span> DeleteAll();
- };
- </pre></div><h2><a class="anchor" name="doc_addon_dict_2">
- Public script interface</a></h2>
- <pre>
- class dictionary
- {
- void set(const string &in key, ? &in value);
- bool get(const string &in value, ? &out value) const;</pre><p>
- <pre> void set(const string &in key, int64 &in value);
- bool get(const string &in key, int64 &out value) const;</pre><p>
- <pre> void set(const string &in key, double &in value);
- bool get(const string &in key, double &out value) const;</pre><p>
- <pre> bool exists(const string &in key) const;
- void delete(const string &in key);
- void deleteAll();
- }
- </pre><h2><a class="anchor" name="doc_addon_dict_3">
- Script example</a></h2>
- <pre>
- dictionary dict;
- obj object;
- obj @handle;</pre><p>
- <pre> dict.set("one", 1);
- dict.set("object", object);
- dict.set("handle", @handle);</pre><p>
- <pre> if( dict.exists("one") )
- {
- bool found = dict.get("handle", @handle);
- if( found )
- {
- dict.delete("object");
- }
- }</pre><p>
- <pre> dict.deleteAll();
- </pre> </div>
- <hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 16 19:34:50 2009 for AngelScript by
- <a href="http://www.doxygen.org/index.html">
- <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
- </body>
- </html>