blob: fcf3e59df783053a1c9d4a20fe11da289d0822b0 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.7-->
<!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"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<title>RapidJSON: Encoding 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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygenextra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="topbanner"><a href="https://github.com/Tencent/rapidjson" title="RapidJSON GitHub"><i class="githublogo"></i></a></div>
<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>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classrapidjson_1_1_encoding.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</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 class="header">
<div class="headertitle">
<div class="title">Encoding Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Concept for encoding of Unicode characters.
<a href="classrapidjson_1_1_encoding.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="encodings_8h_source.html">encodings.h</a>&gt;</code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Concept for encoding of Unicode characters. </p>
<div class="fragment"><div class="line">concept <a class="code" href="classrapidjson_1_1_encoding.html">Encoding</a> {</div>
<div class="line"> <span class="keyword">typename</span> Ch; <span class="comment">//! Type of character. A &quot;character&quot; is actually a code unit in unicode&#39;s definition.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"> <span class="keyword">enum</span> { supportUnicode = 1 }; <span class="comment">// or 0 if not supporting unicode</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! \brief Encode a Unicode codepoint to an output stream.</span></div>
<div class="line"><span class="comment"> //! \param os Output stream.</span></div>
<div class="line"><span class="comment"> //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OutputStream&gt;</div>
<div class="line"> <span class="keyword">static</span> <span class="keywordtype">void</span> Encode(OutputStream&amp; os, <span class="keywordtype">unsigned</span> codepoint);</div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! \brief Decode a Unicode codepoint from an input stream.</span></div>
<div class="line"><span class="comment"> //! \param is Input stream.</span></div>
<div class="line"><span class="comment"> //! \param codepoint Output of the unicode codepoint.</span></div>
<div class="line"><span class="comment"> //! \return true if a valid codepoint can be decoded from the stream.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> InputStream&gt;</div>
<div class="line"> <span class="keyword">static</span> <span class="keywordtype">bool</span> Decode(InputStream&amp; is, <span class="keywordtype">unsigned</span>* codepoint);</div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! \brief Validate one Unicode codepoint from an encoded stream.</span></div>
<div class="line"><span class="comment"> //! \param is Input stream to obtain codepoint.</span></div>
<div class="line"><span class="comment"> //! \param os Output for copying one codepoint.</span></div>
<div class="line"><span class="comment"> //! \return true if it is valid.</span></div>
<div class="line"><span class="comment"> //! \note This function just validating and copying the codepoint without actually decode it.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> InputStream, <span class="keyword">typename</span> OutputStream&gt;</div>
<div class="line"> <span class="keyword">static</span> <span class="keywordtype">bool</span> Validate(InputStream&amp; is, OutputStream&amp; os);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// The following functions are deal with byte streams.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! Take a character from input byte stream, skip BOM if exist.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> InputByteStream&gt;</div>
<div class="line"> <span class="keyword">static</span> CharType TakeBOM(InputByteStream&amp; is);</div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! Take a character from input byte stream.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> InputByteStream&gt;</div>
<div class="line"> <span class="keyword">static</span> Ch Take(InputByteStream&amp; is);</div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! Put BOM to output byte stream.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> OutputByteStream&gt;</div>
<div class="line"> <span class="keyword">static</span> <span class="keywordtype">void</span> PutBOM(OutputByteStream&amp; os);</div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> //! Put a character to output byte stream.</span></div>
<div class="line"><span class="comment"></span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> OutputByteStream&gt;</div>
<div class="line"> <span class="keyword">static</span> <span class="keywordtype">void</span> Put(OutputByteStream&amp; os, Ch c);</div>
<div class="line">};</div>
</div><!-- fragment --> </div><hr/>The documentation for this class was generated from the following file:<ul>
<li>include/rapidjson/<a class="el" href="encodings_8h_source.html">encodings.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclassrapidjson_1_1_encoding_html"><div class="ttname"><a href="classrapidjson_1_1_encoding.html">Encoding</a></div><div class="ttdoc">Concept for encoding of Unicode characters.</div></div>
<!-- HTML footer for doxygen 1.8.7-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="classrapidjson_1_1_encoding.html">Encoding</a></li>
</ul>
</div>
</body>
</html>