comunic/3rdparty/luminous/docs/html/classLuminousUtils.html

310 lines
14 KiB
HTML
Raw Permalink Normal View History

2016-11-19 11:08:12 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Luminous: LuminousUtils Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Luminous
&#160;<span id="projectnumber">git-master</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classLuminousUtils-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">LuminousUtils Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A set of utility functions for scanners.
<a href="classLuminousUtils.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a2ac54e45d680481dcce190154d8ff0d9"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousUtils.html#a2ac54e45d680481dcce190154d8ff0d9">balance_delimiter</a> ($delimiter)</td></tr>
<tr class="memdesc:a2ac54e45d680481dcce190154d8ff0d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tries to balance a delimiter. <a href="#a2ac54e45d680481dcce190154d8ff0d9"></a><br/></td></tr>
<tr class="memitem:a25ba2a727a415d71c3d57fd03bdf95ea"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousUtils.html#a25ba2a727a415d71c3d57fd03bdf95ea">escape_string</a> ($string)</td></tr>
<tr class="memdesc:a25ba2a727a415d71c3d57fd03bdf95ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Escapes a string suitable for use in XML. <a href="#a25ba2a727a415d71c3d57fd03bdf95ea"></a><br/></td></tr>
<tr class="memitem:a5f41f0e028071fb66f201a13d244cc8a"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousUtils.html#a5f41f0e028071fb66f201a13d244cc8a">escape_token</a> ($token)</td></tr>
<tr class="memdesc:a5f41f0e028071fb66f201a13d244cc8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Escapes a token so its string is suitable for use in XML. <a href="#a5f41f0e028071fb66f201a13d244cc8a"></a><br/></td></tr>
<tr class="memitem:ab2cb0b63cfbf8767c8e5a2837ae8d4c7"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousUtils.html#ab2cb0b63cfbf8767c8e5a2837ae8d4c7">pcre_error_decode</a> ($errcode)</td></tr>
<tr class="memdesc:ab2cb0b63cfbf8767c8e5a2837ae8d4c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes PCRE error codes to human readable strings. <a href="#ab2cb0b63cfbf8767c8e5a2837ae8d4c7"></a><br/></td></tr>
<tr class="memitem:a50b5bcd2eb6e5c5c452899e42fe2fcc8"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLuminousUtils.html#a50b5bcd2eb6e5c5c452899e42fe2fcc8">tag_block</a> ($type, $block, $split_multiline=true)</td></tr>
<tr class="memdesc:a50b5bcd2eb6e5c5c452899e42fe2fcc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wraps a block of text in an XML tag. <a href="#a50b5bcd2eb6e5c5c452899e42fe2fcc8"></a><br/></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A set of utility functions for scanners. </p>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="a2ac54e45d680481dcce190154d8ff0d9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static LuminousUtils::balance_delimiter </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$delimiter</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Tries to balance a delimiter. </p>
<p>Tries to 'balance' a single character delimiter, i.e: '(' is mapped to ')' '{' is mapped to '}', '[' is mapped to ']', '&lt;' is mapped to '&gt;' Any other character is mapped to itself.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$delimiter</td><td>the left/opening delimiter to try to balance </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The corresponding close delimiter character, or the input character. </dd></dl>
</div>
</div>
<a class="anchor" id="a25ba2a727a415d71c3d57fd03bdf95ea"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static LuminousUtils::escape_string </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$string</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Escapes a string suitable for use in XML. </p>
<p>Escapes a string according to the Luminous internal escaping format (this is currently htmlspecialchars with ENT_NOQUOTES.) </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$string</td><td>the string to escape </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the escaped string </dd></dl>
</div>
</div>
<a class="anchor" id="a5f41f0e028071fb66f201a13d244cc8a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static LuminousUtils::escape_token </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$token</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Escapes a token so its string is suitable for use in XML. </p>
<p>Escapes a token. If the token is already escaped, nothing changes. If the token is not escaped, the escaped flag is set (index 2) and the token text (index 1) is escaped according to the internal escaping format </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$token</td><td>the token to escape </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the escaped token </dd></dl>
</div>
</div>
<a class="anchor" id="ab2cb0b63cfbf8767c8e5a2837ae8d4c7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static LuminousUtils::pcre_error_decode </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$errcode</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Decodes PCRE error codes to human readable strings. </p>
<p>Decodes a PCRE error code, which was returned by preg_last_error(), to something readable </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$errcode</td><td>the error code </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error description, as string. This is currently the same as the constant name, so the constant PREG_NO_ERROR is mapped to the string 'PREG_NO_ERROR' </dd></dl>
</div>
</div>
<a class="anchor" id="a50b5bcd2eb6e5c5c452899e42fe2fcc8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static LuminousUtils::tag_block </td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$block</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>$split_multiline</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Wraps a block of text in an XML tag. </p>
<p>Tags a block of text. The block is assumed to have been escaped correctly with <a class="el" href="classLuminousUtils.html#a25ba2a727a415d71c3d57fd03bdf95ea" title="Escapes a string suitable for use in XML.">LuminousUtils::escape_string</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">$type</td><td>the type to tag the string as, this is the token name </td></tr>
<tr><td class="paramname">$block</td><td>the block of text </td></tr>
<tr><td class="paramname">$split_multiline</td><td>if this is set to true, the tags are closed at the end of each line and re-opened again on the next line. This is useful for output formats like HTML, where spanning multiple lines could break the markup </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The tagged block of text. This resembles an XML fragment. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/core/utils.class.php</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jan 12 2013 16:03:50 for Luminous by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>