mirror of
https://github.com/xomboverlord/xomb-docs.git
synced 2026-01-11 18:33:17 +01:00
110 lines
4.0 KiB
HTML
110 lines
4.0 KiB
HTML
<html><head>
|
|
<META http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<title>kernel.core.util</title>
|
|
</head><body>
|
|
<h1>kernel.core.util</h1>
|
|
<!-- Generated by Ddoc from ../kernel/core/util.d -->
|
|
<br><br>
|
|
<dl><dt><big>template <u>FieldNames</u>(S,int idx = 0)</big></dt>
|
|
<dd>Given a struct type, gives a tuple of strings of the names of fields in the struct.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isCharType</u>(T)</big></dt>
|
|
<dd>Sees if a type is char, wchar, or dchar.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isIntType</u>(T)</big></dt>
|
|
<dd>Sees if a type is a signed or unsigned byte, short, int, or long.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isUnsignedIntType</u>(T)</big></dt>
|
|
<dd>Sees if a type is a signed or unsigned byte, short, int, or long.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isSignedIntType</u>(T)</big></dt>
|
|
<dd>Sees if a type is a signed or unsigned byte, short, int, or long.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isFloatType</u>(T)</big></dt>
|
|
<dd>Sees if a type is float, double, or real.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isArrayType</u>(T)</big></dt>
|
|
<dd>Sees if a type is an array.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isAAType</u>(T)</big></dt>
|
|
<dd>Sees if a type is an associative array.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>isPointerType</u>(T)</big></dt>
|
|
<dd>Sees if a type is a pointer.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>realType</u>(T)</big></dt>
|
|
<dd>Get to the bottom of any chain of typedefs! Returns the first non-typedef'ed type.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>IsLower</u>(char c)</big></dt>
|
|
<dd>See if a character is a lowercase character.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>IsUpper</u>(char c)</big></dt>
|
|
<dd>See if a character is an uppercase character.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>ToLower</u>(char c)<br>template <u>ToLower</u>(char[] s)</big></dt>
|
|
<dd>Convert a character or string to lowercase.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>ToUpper</u>(char c)<br>template <u>ToUpper</u>(char[] s)</big></dt>
|
|
<dd>Convert a character or string to uppercase.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>Capitalize</u>(char[] s)</big></dt>
|
|
<dd><u>Capitalize</u> a word so that the first letter is capital.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>Map</u>(alias Templ,List...)</big></dt>
|
|
<dd>Compile-time map. Takes a template "function" which should take a single argument
|
|
of the type of the elements of the list of values that follows. Resolves to a tuple.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>Reduce</u>(alias Templ,List...)</big></dt>
|
|
<dd>Compile-time reduce. Takes a template "function" that should take two arguments of the type
|
|
of the elements of the list of values that follows. The list must be at least one element
|
|
long. Resolves to a single value of the type that the template function returns.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>Range</u>(uint min,uint max)<br>template <u>Range</u>(uint max)</big></dt>
|
|
<dd>Compile-time range. Given lower and upper bound, yields a tuple of integers in the
|
|
range [min, max).<br><br>
|
|
|
|
</dd>
|
|
<dt><big>template <u>Cat</u>(T...)</big></dt>
|
|
<dd>Compile time metafunction meant to be used with Reduce. Concatenates its first two
|
|
arguments and resolves to the result of that concatentation.<br><br>
|
|
|
|
</dd>
|
|
<dt><big>char[] <u>itoa</u>(char[] <i>buf</i>, char <i>base</i>, long <i>d</i>);
|
|
</big></dt>
|
|
<dd>This function converts an integer to a string, depending on the <i>base</i> passed in.
|
|
<br><br>
|
|
<b>Params:</b><br>
|
|
<table><tr><td>char[] <i>buf</i></td>
|
|
<td>The function will save the translated string into this character array.</td></tr>
|
|
<tr><td>char <i>base</i></td>
|
|
<td>The <i>base</i> of the integer value. If "<i>d</i>," it will be assumed to be decimal. If "x," the integer
|
|
will be hexadecimal.</td></tr>
|
|
<tr><td>long <i>d</i></td>
|
|
<td>The integer to translate.</td></tr>
|
|
</table><br>
|
|
<b>Returns:</b><br>
|
|
The translated string in a character array.<br><br>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
|
|
</body></html>
|