blob: 29b71e824d2c15ff7275dfaa1ee774db53b51f82 [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: rapidjson::GenericMemoryBuffer&lt; Allocator &gt; Struct Template 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('structrapidjson_1_1_generic_memory_buffer.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="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="structrapidjson_1_1_generic_memory_buffer-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">rapidjson::GenericMemoryBuffer&lt; Allocator &gt; Struct Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Represents an in-memory output byte stream.
<a href="structrapidjson_1_1_generic_memory_buffer.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="memorybuffer_8h_source.html">memorybuffer.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a7c2ccd0d38df6d3cb3abd5aed9e100f8"><td class="memItemLeft" align="right" valign="top"><a id="a7c2ccd0d38df6d3cb3abd5aed9e100f8"></a>
typedef char&#160;</td><td class="memItemRight" valign="bottom"><b>Ch</b></td></tr>
<tr class="separator:a7c2ccd0d38df6d3cb3abd5aed9e100f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a56c70223d8897e245df31e22a1fea60f"><td class="memItemLeft" align="right" valign="top"><a id="a56c70223d8897e245df31e22a1fea60f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>GenericMemoryBuffer</b> (<a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> *allocator=0, size_t capacity=kDefaultCapacity)</td></tr>
<tr class="separator:a56c70223d8897e245df31e22a1fea60f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a882b45865eb98aa84241ef8b87bae96d"><td class="memItemLeft" align="right" valign="top"><a id="a882b45865eb98aa84241ef8b87bae96d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>Put</b> (Ch c)</td></tr>
<tr class="separator:a882b45865eb98aa84241ef8b87bae96d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66a3e80663d94506cab0117777486a06"><td class="memItemLeft" align="right" valign="top"><a id="a66a3e80663d94506cab0117777486a06"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>Flush</b> ()</td></tr>
<tr class="separator:a66a3e80663d94506cab0117777486a06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b2639889f687f0f6f1b90181918f273"><td class="memItemLeft" align="right" valign="top"><a id="a1b2639889f687f0f6f1b90181918f273"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>Clear</b> ()</td></tr>
<tr class="separator:a1b2639889f687f0f6f1b90181918f273"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af10d96902f7aea2eae23269c11398fbb"><td class="memItemLeft" align="right" valign="top"><a id="af10d96902f7aea2eae23269c11398fbb"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>ShrinkToFit</b> ()</td></tr>
<tr class="separator:af10d96902f7aea2eae23269c11398fbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a070ea27ab1e80df671ced9edb7d03150"><td class="memItemLeft" align="right" valign="top"><a id="a070ea27ab1e80df671ced9edb7d03150"></a>
Ch *&#160;</td><td class="memItemRight" valign="bottom"><b>Push</b> (size_t count)</td></tr>
<tr class="separator:a070ea27ab1e80df671ced9edb7d03150"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcbad3bf8a20a90b6b586e63b07aed40"><td class="memItemLeft" align="right" valign="top"><a id="abcbad3bf8a20a90b6b586e63b07aed40"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>Pop</b> (size_t count)</td></tr>
<tr class="separator:abcbad3bf8a20a90b6b586e63b07aed40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c05ddb3b37a57fc941d7b377e95b67a"><td class="memItemLeft" align="right" valign="top"><a id="a2c05ddb3b37a57fc941d7b377e95b67a"></a>
const Ch *&#160;</td><td class="memItemRight" valign="bottom"><b>GetBuffer</b> () const</td></tr>
<tr class="separator:a2c05ddb3b37a57fc941d7b377e95b67a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67f68c4192d6f1a7a90315f5c9bf2930"><td class="memItemLeft" align="right" valign="top"><a id="a67f68c4192d6f1a7a90315f5c9bf2930"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>GetSize</b> () const</td></tr>
<tr class="separator:a67f68c4192d6f1a7a90315f5c9bf2930"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a80a159ebb64cee80b5e7fc37f971d5a5"><td class="memItemLeft" align="right" valign="top"><a id="a80a159ebb64cee80b5e7fc37f971d5a5"></a>
internal::Stack&lt; <a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>stack_</b></td></tr>
<tr class="separator:a80a159ebb64cee80b5e7fc37f971d5a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:abaa207fb3f94da48b0c91755828f98b3"><td class="memItemLeft" align="right" valign="top"><a id="abaa207fb3f94da48b0c91755828f98b3"></a>
static const size_t&#160;</td><td class="memItemRight" valign="bottom"><b>kDefaultCapacity</b> = 256</td></tr>
<tr class="separator:abaa207fb3f94da48b0c91755828f98b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Allocator = CrtAllocator&gt;<br />
struct rapidjson::GenericMemoryBuffer&lt; Allocator &gt;</h3>
<p>Represents an in-memory output byte stream. </p>
<p>This class is mainly for being wrapped by <a class="el" href="classrapidjson_1_1_encoded_output_stream.html" title="Output byte stream wrapper with statically bound encoding.">EncodedOutputStream</a> or <a class="el" href="classrapidjson_1_1_auto_u_t_f_output_stream.html" title="Output stream wrapper with dynamically bound encoding and automatic encoding detection.">AutoUTFOutputStream</a>.</p>
<p>It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.</p>
<p>Differences between MemoryBuffer and StringBuffer:</p><ol type="1">
<li>StringBuffer has <a class="el" href="classrapidjson_1_1_encoding.html" title="Concept for encoding of Unicode characters.">Encoding</a> but MemoryBuffer is only a byte buffer.</li>
<li>StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.</li>
</ol>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname"><a class="el" href="classrapidjson_1_1_allocator.html" title="Concept for allocating, resizing and freeing memory block.">Allocator</a></td><td>type for allocating memory buffer. </td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>implements <a class="el" href="classrapidjson_1_1_stream.html" title="Concept for reading and writing characters.">Stream</a> concept </dd></dl>
</div><hr/>The documentation for this struct was generated from the following files:<ul>
<li>include/rapidjson/<a class="el" href="fwd_8h_source.html">fwd.h</a></li>
<li>include/rapidjson/<a class="el" href="memorybuffer_8h_source.html">memorybuffer.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- 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="namespacerapidjson.html">rapidjson</a></li><li class="navelem"><a class="el" href="structrapidjson_1_1_generic_memory_buffer.html">GenericMemoryBuffer</a></li>
</ul>
</div>
</body>
</html>