2016-01-16 22:15:15 +01:00

306 lines
7.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>utils</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>utils</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/stringutil.html">stringutil</a></li>
<li><a href="../modules/random.html">random</a></li>
<li><a href="../modules/noisemanager.html">noisemanager</a></li>
<li><a href="../modules/nodeutil.html">nodeutil</a></li>
<li><a href="../modules/posutil.html">posutil</a></li>
<li><a href="../modules/objectrefutil.html">objectrefutil</a></li>
<li><a href="../modules/nodeboxutil.html">nodeboxutil</a></li>
<li><a href="../modules/mapmanipulator.html">mapmanipulator</a></li>
<li><a href="../modules/fisheryates.html">fisheryates</a></li>
<li><a href="../modules/textureutil.html">textureutil</a></li>
<li><a href="../modules/blockutil.html">blockutil</a></li>
<li><a href="../modules/tango.html">tango</a></li>
<li><a href="../modules/arraymanipulator.html">arraymanipulator</a></li>
<li><a href="../modules/inventoryutil.html">inventoryutil</a></li>
<li><a href="../modules/entityutil.html">entityutil</a></li>
<li><a href="../modules/scheduler.html">scheduler</a></li>
<li><a href="../modules/blockedcache.html">blockedcache</a></li>
<li><a href="../modules/mathutil.html">mathutil</a></li>
<li><a href="../modules/log.html">log</a></li>
<li><a href="../modules/arrayutil.html">arrayutil</a></li>
<li><a href="../modules/directmapmanipulator.html">directmapmanipulator</a></li>
<li><a href="../modules/rotationutil.html">rotationutil</a></li>
<li><a href="../modules/settings.html">settings</a></li>
<li><a href="../modules/pathutil.html">pathutil</a></li>
<li><a href="../modules/wallmountedutil.html">wallmountedutil</a></li>
<li><a href="../modules/interpolate.html">interpolate</a></li>
<li><a href="../modules/transform.html">transform</a></li>
<li><a href="../modules/numberutil.html">numberutil</a></li>
<li><a href="../modules/test.html">test</a></li>
<li><a href="../modules/facedirutil.html">facedirutil</a></li>
<li><a href="../modules/constants.html">constants</a></li>
<li><a href="../modules/minetestex.html">minetestex</a></li>
<li><a href="../modules/list.html">list</a></li>
<li><a href="../modules/stopwatch.html">stopwatch</a></li>
<li><a href="../modules/itemutil.html">itemutil</a></li>
<li><a href="../modules/color.html">color</a></li>
<li><strong>tableutil</strong></li>
</ul>
</div>
<div id="content">
<h1>Module <code>tableutil</code></h1>
<p>Various utility functions for working with tables.</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#clone">clone (table)</a></td>
<td class="summary">Performs a deep/recursive clone on the given table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#comparator">comparator (a, b)</a></td>
<td class="summary">A comparator function that can be used for sorting a table with different
value types.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#equals">equals (a, b)</a></td>
<td class="summary">Tests the two given tables for equality.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#keys">keys (...)</a></td>
<td class="summary">Returns a (unique) list with all keys of all tables.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#merge">merge (...)</a></td>
<td class="summary">Merges the given tables into one instance.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to_string">to_string (table, one_line, table_ids, indent)</a></td>
<td class="summary">Returns the string representation of the given table.</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "clone"></a>
<strong>clone (table)</strong>
</dt>
<dd>
Performs a deep/recursive clone on the given table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
The table to deep clone.
</li>
</ul>
<h3>Returns:</h3>
<ol>
The clone of the table.
</ol>
</dd>
<dt>
<a name = "comparator"></a>
<strong>comparator (a, b)</strong>
</dt>
<dd>
A comparator function that can be used for sorting a table with different
value types. It sorts numbers first, after that strings, tables and nil.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">a</span>
The first value.
</li>
<li><span class="parameter">b</span>
The second value.
</li>
</ul>
<h3>Returns:</h3>
<ol>
true if the first value is less than (should come before) the second.
</ol>
</dd>
<dt>
<a name = "equals"></a>
<strong>equals (a, b)</strong>
</dt>
<dd>
Tests the two given tables for equality.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">a</span>
The first table.
</li>
<li><span class="parameter">b</span>
The second table.
</li>
</ul>
<h3>Returns:</h3>
<ol>
true if the tables are equal.
</ol>
</dd>
<dt>
<a name = "keys"></a>
<strong>keys (...)</strong>
</dt>
<dd>
Returns a (unique) list with all keys of all tables.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
The list of tables.
</li>
</ul>
<h3>Returns:</h3>
<ol>
A list with all keys.
</ol>
</dd>
<dt>
<a name = "merge"></a>
<strong>merge (...)</strong>
</dt>
<dd>
Merges the given tables into one instance. Note that no cloning is performed
so fields may refer to the same instances.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
The tables to merge.
</li>
</ul>
<h3>Returns:</h3>
<ol>
The merged table.
</ol>
</dd>
<dt>
<a name = "to_string"></a>
<strong>to_string (table, one_line, table_ids, indent)</strong>
</dt>
<dd>
Returns the string representation of the given table.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
The table.
</li>
<li><span class="parameter">one_line</span>
Optional. If the table should be printed on only one line.
Defaults to false.
</li>
<li><span class="parameter">table_ids</span>
Optional. If the table IDs should be printed.
Defaults to true.
</li>
<li><span class="parameter">indent</span>
Optional. The number of spaces of indentation.
</li>
</ul>
<h3>Returns:</h3>
<ol>
The string representation of the given table.
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>