forked from unicode-org/icu-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bytestream_8h_source.html
229 lines (227 loc) · 37.9 KB
/
bytestream_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ICU 74.1: common/unicode/bytestream.h Source File</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/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></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 id="projectrow">
<td id="projectalign">
<div id="projectname">ICU 74.1<span id="projectnumber"> 74.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_f59c6450ff718ff1b085cfd1c36acbd7.html">unicode</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">bytestream.h</div></div>
</div><!--header-->
<div class="contents">
<a href="bytestream_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// © 2016 and later: Unicode, Inc. and others.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// License & terms of use: http://www.unicode.org/copyright.html</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// Copyright (C) 2009-2012, International Business Machines</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// Corporation and others. All Rights Reserved.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">//</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// Copyright 2007 Google Inc. All Rights Reserved.</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// Author: [email protected] (Sanjay Ghemawat)</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">//</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// Abstract interface that consumes a sequence of bytes (ByteSink).</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">//</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// Used so that we can write a single piece of code that can operate</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// on a variety of output string types.</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">//</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// Various implementations of this interface are provided:</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// ByteSink:</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// CheckedArrayByteSink Write to a flat array, with bounds checking</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">// StringByteSink Write to an STL string</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// This code is a contribution of Google code, and the style used here is</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">// a compromise between the original Google code and the ICU coding guidelines.</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">// For example, data types are ICU-ified (size_t,int->int32_t),</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// and API comments doxygen-ified, but function names and behavior are</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// as in the original, if possible.</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">// Assertion-style error handling, not available in ICU, was changed to</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">// parameter "pinning" similar to UnicodeString.</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">//</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// In addition, this is only a partial port of the original Google code,</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// limited to what was needed so far. The (nearly) complete original code</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">// is in the ICU svn repository at icuhtml/trunk/design/strings/contrib</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment">// (see ICU ticket 6765, r25517).</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#ifndef __BYTESTREAM_H__</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor">#define __BYTESTREAM_H__</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor">#include "<a class="code" href="utypes_8h.html">unicode/utypes.h</a>"</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor">#if U_SHOW_CPLUSPLUS_API</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor">#include "<a class="code" href="uobject_8h.html">unicode/uobject.h</a>"</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="preprocessor">#include "<a class="code" href="std__string_8h.html">unicode/std_string.h</a>"</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>U_NAMESPACE_BEGIN</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html"> 53</a></span><span class="keyword">class </span><a class="code hl_define" href="utypes_8h.html#a559955ec3bc692657c5d8b1c6de8e334">U_COMMON_API</a> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a> : <span class="keyword">public</span> <a class="code hl_class" href="classicu_1_1UMemory.html">UMemory</a> {</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#ac3e9a257c1fd9e981bceb8f6981d9b6e"> 59</a></span> <a class="code hl_function" href="classicu_1_1ByteSink.html#ac3e9a257c1fd9e981bceb8f6981d9b6e">ByteSink</a>() { }</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#aeea90b9a402f4446d493f7e6cc3361c0"> 64</a></span> <span class="keyword">virtual</span> <a class="code hl_function" href="classicu_1_1ByteSink.html#aeea90b9a402f4446d493f7e6cc3361c0">~ByteSink</a>();</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#a61fe994281322e8a3e3ed2e50c910e41"> 72</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classicu_1_1ByteSink.html#a61fe994281322e8a3e3ed2e50c910e41">Append</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* bytes, int32_t n) = 0;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#a2d5b62995d93a766a52651fcac809591"> 85</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classicu_1_1ByteSink.html#a2d5b62995d93a766a52651fcac809591">AppendU8</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* bytes, int32_t n) {</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> Append(bytes, n);</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> }</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="preprocessor">#if defined(__cpp_char8_t) || defined(U_IN_DOXYGEN)</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#aceeb6e6dd959bf559b7c5e656e3ba107"> 101</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classicu_1_1ByteSink.html#aceeb6e6dd959bf559b7c5e656e3ba107">AppendU8</a>(<span class="keyword">const</span> <span class="keywordtype">char8_t</span>* bytes, int32_t n) {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> Append(<span class="keyword">reinterpret_cast<</span><span class="keyword">const </span><span class="keywordtype">char</span>*<span class="keyword">></span>(bytes), n);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#a0c57b38e086aaa1ed08ffaff9be6af90"> 148</a></span> <span class="keyword">virtual</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="classicu_1_1ByteSink.html#a0c57b38e086aaa1ed08ffaff9be6af90">GetAppendBuffer</a>(int32_t min_capacity,</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> int32_t desired_capacity_hint,</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordtype">char</span>* scratch, int32_t scratch_capacity,</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> int32_t* result_capacity);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"><a class="line" href="classicu_1_1ByteSink.html#ad8b12cabefa31cfcdd1dc166a9f829f2"> 161</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classicu_1_1ByteSink.html#ad8b12cabefa31cfcdd1dc166a9f829f2">Flush</a>();</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> </div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a>(<span class="keyword">const</span> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a> &) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a> &operator=(<span class="keyword">const</span> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a> &) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span>};</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="comment">// -------------------------------------------------------------</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="comment">// Some standard implementations</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html"> 180</a></span><span class="keyword">class </span><a class="code hl_define" href="utypes_8h.html#a559955ec3bc692657c5d8b1c6de8e334">U_COMMON_API</a> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a> : <span class="keyword">public</span> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a> {</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#a2ad2fd80f945eb971384e704a24a4da4"> 188</a></span> <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#a2ad2fd80f945eb971384e704a24a4da4">CheckedArrayByteSink</a>(<span class="keywordtype">char</span>* outbuf, int32_t capacity);</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#a2f00ab1d8ddcd922c65449ebb435bc04"> 193</a></span> <span class="keyword">virtual</span> <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#a2f00ab1d8ddcd922c65449ebb435bc04">~CheckedArrayByteSink</a>();</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#a7688f8b5d319cc3c7fe5eb463bcb3e0d"> 202</a></span> <span class="keyword">virtual</span> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a>& <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#a7688f8b5d319cc3c7fe5eb463bcb3e0d">Reset</a>();</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#ac5b828c4a8c4d65fdca6860f02e72c89"> 209</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#ac5b828c4a8c4d65fdca6860f02e72c89">Append</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* bytes, int32_t n) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#ad5728a62c5a1563dba0b2c26ebd3f907"> 224</a></span> <span class="keyword">virtual</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#ad5728a62c5a1563dba0b2c26ebd3f907">GetAppendBuffer</a>(int32_t min_capacity,</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> int32_t desired_capacity_hint,</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keywordtype">char</span>* scratch, int32_t scratch_capacity,</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> int32_t* result_capacity) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#a0e10087229f4a410e759822fcfa89edb"> 233</a></span> int32_t <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#a0e10087229f4a410e759822fcfa89edb">NumberOfBytesWritten</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> size_; }</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#ab1b0344012dae42c91b43b553a048eac"> 240</a></span> <a class="code hl_typedef" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#ab1b0344012dae42c91b43b553a048eac">Overflowed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> overflowed_; }</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="classicu_1_1CheckedArrayByteSink.html#a8c3c34a78801711969e3199e3a4d69de"> 248</a></span> int32_t <a class="code hl_function" href="classicu_1_1CheckedArrayByteSink.html#a8c3c34a78801711969e3199e3a4d69de">NumberOfBytesAppended</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> appended_; }</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="keywordtype">char</span>* outbuf_;</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keyword">const</span> int32_t capacity_;</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> int32_t size_;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> int32_t appended_;</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> <a class="code hl_typedef" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> overflowed_;</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> </div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a>() = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a>(<span class="keyword">const</span> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a> &) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a> &operator=(<span class="keyword">const</span> <a class="code hl_class" href="classicu_1_1CheckedArrayByteSink.html">CheckedArrayByteSink</a> &) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span>};</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> </div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span><span class="keyword">template</span><<span class="keyword">typename</span> StringClass></div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"><a class="line" href="classicu_1_1StringByteSink.html"> 267</a></span><span class="keyword">class </span><a class="code hl_class" href="classicu_1_1StringByteSink.html">StringByteSink</a> : <span class="keyword">public</span> <a class="code hl_class" href="classicu_1_1ByteSink.html">ByteSink</a> {</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"><a class="line" href="classicu_1_1StringByteSink.html#acf5001ee1201ba4821defafcc409250d"> 274</a></span> <a class="code hl_function" href="classicu_1_1StringByteSink.html#acf5001ee1201ba4821defafcc409250d">StringByteSink</a>(StringClass* dest) : dest_(dest) { }</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"><a class="line" href="classicu_1_1StringByteSink.html#a6bbb302649c70493ae10aec7831df7c7"> 282</a></span> <a class="code hl_function" href="classicu_1_1StringByteSink.html#a6bbb302649c70493ae10aec7831df7c7">StringByteSink</a>(StringClass* dest, int32_t initialAppendCapacity) : dest_(dest) {</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> <span class="keywordflow">if</span> (initialAppendCapacity > 0 &&</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> (uint32_t)initialAppendCapacity > (dest->capacity() - dest->length())) {</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> dest->reserve(dest->length() + initialAppendCapacity);</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> }</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> }</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"><a class="line" href="classicu_1_1StringByteSink.html#ae452e5c53dc33bdcb83fbc27585264d0"> 294</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classicu_1_1StringByteSink.html#ae452e5c53dc33bdcb83fbc27585264d0">Append</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* data, int32_t n)<span class="keyword"> override </span>{ dest_->append(data, n); }</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> StringClass* dest_;</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> </div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> <a class="code hl_class" href="classicu_1_1StringByteSink.html">StringByteSink</a>() = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <a class="code hl_class" href="classicu_1_1StringByteSink.html">StringByteSink</a>(<span class="keyword">const</span> <a class="code hl_class" href="classicu_1_1StringByteSink.html">StringByteSink</a> &) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <a class="code hl_class" href="classicu_1_1StringByteSink.html">StringByteSink</a> &operator=(<span class="keyword">const</span> <a class="code hl_class" href="classicu_1_1StringByteSink.html">StringByteSink</a> &) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span>};</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> </div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span>U_NAMESPACE_END</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> </div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span><span class="preprocessor">#endif </span><span class="comment">/* U_SHOW_CPLUSPLUS_API */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> </div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span><span class="preprocessor">#endif </span><span class="comment">// __BYTESTREAM_H__</span></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html"><div class="ttname"><a href="classicu_1_1ByteSink.html">icu::ByteSink</a></div><div class="ttdoc">A ByteSink can be filled with bytes.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00053">bytestream.h:53</a></div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_a0c57b38e086aaa1ed08ffaff9be6af90"><div class="ttname"><a href="classicu_1_1ByteSink.html#a0c57b38e086aaa1ed08ffaff9be6af90">icu::ByteSink::GetAppendBuffer</a></div><div class="ttdeci">virtual char * GetAppendBuffer(int32_t min_capacity, int32_t desired_capacity_hint, char *scratch, int32_t scratch_capacity, int32_t *result_capacity)</div><div class="ttdoc">Returns a writable buffer for appending and writes the buffer's capacity to *result_capacity.</div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_a2d5b62995d93a766a52651fcac809591"><div class="ttname"><a href="classicu_1_1ByteSink.html#a2d5b62995d93a766a52651fcac809591">icu::ByteSink::AppendU8</a></div><div class="ttdeci">void AppendU8(const char *bytes, int32_t n)</div><div class="ttdoc">Appends n bytes to this.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00085">bytestream.h:85</a></div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_a61fe994281322e8a3e3ed2e50c910e41"><div class="ttname"><a href="classicu_1_1ByteSink.html#a61fe994281322e8a3e3ed2e50c910e41">icu::ByteSink::Append</a></div><div class="ttdeci">virtual void Append(const char *bytes, int32_t n)=0</div><div class="ttdoc">Append "bytes[0,n-1]" to this.</div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_ac3e9a257c1fd9e981bceb8f6981d9b6e"><div class="ttname"><a href="classicu_1_1ByteSink.html#ac3e9a257c1fd9e981bceb8f6981d9b6e">icu::ByteSink::ByteSink</a></div><div class="ttdeci">ByteSink()</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00059">bytestream.h:59</a></div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_aceeb6e6dd959bf559b7c5e656e3ba107"><div class="ttname"><a href="classicu_1_1ByteSink.html#aceeb6e6dd959bf559b7c5e656e3ba107">icu::ByteSink::AppendU8</a></div><div class="ttdeci">void AppendU8(const char8_t *bytes, int32_t n)</div><div class="ttdoc">Appends n bytes to this.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00101">bytestream.h:101</a></div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_ad8b12cabefa31cfcdd1dc166a9f829f2"><div class="ttname"><a href="classicu_1_1ByteSink.html#ad8b12cabefa31cfcdd1dc166a9f829f2">icu::ByteSink::Flush</a></div><div class="ttdeci">virtual void Flush()</div><div class="ttdoc">Flush internal buffers.</div></div>
<div class="ttc" id="aclassicu_1_1ByteSink_html_aeea90b9a402f4446d493f7e6cc3361c0"><div class="ttname"><a href="classicu_1_1ByteSink.html#aeea90b9a402f4446d493f7e6cc3361c0">icu::ByteSink::~ByteSink</a></div><div class="ttdeci">virtual ~ByteSink()</div><div class="ttdoc">Virtual destructor.</div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html">icu::CheckedArrayByteSink</a></div><div class="ttdoc">Implementation of ByteSink that writes to a flat byte array, with bounds-checking: This sink will not...</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00180">bytestream.h:180</a></div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_a0e10087229f4a410e759822fcfa89edb"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#a0e10087229f4a410e759822fcfa89edb">icu::CheckedArrayByteSink::NumberOfBytesWritten</a></div><div class="ttdeci">int32_t NumberOfBytesWritten() const</div><div class="ttdoc">Returns the number of bytes actually written to the sink.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00233">bytestream.h:233</a></div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_a2ad2fd80f945eb971384e704a24a4da4"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#a2ad2fd80f945eb971384e704a24a4da4">icu::CheckedArrayByteSink::CheckedArrayByteSink</a></div><div class="ttdeci">CheckedArrayByteSink(char *outbuf, int32_t capacity)</div><div class="ttdoc">Constructs a ByteSink that will write to outbuf[0..capacity-1].</div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_a2f00ab1d8ddcd922c65449ebb435bc04"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#a2f00ab1d8ddcd922c65449ebb435bc04">icu::CheckedArrayByteSink::~CheckedArrayByteSink</a></div><div class="ttdeci">virtual ~CheckedArrayByteSink()</div><div class="ttdoc">Destructor.</div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_a7688f8b5d319cc3c7fe5eb463bcb3e0d"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#a7688f8b5d319cc3c7fe5eb463bcb3e0d">icu::CheckedArrayByteSink::Reset</a></div><div class="ttdeci">virtual CheckedArrayByteSink & Reset()</div><div class="ttdoc">Returns the sink to its original state, without modifying the buffer.</div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_a8c3c34a78801711969e3199e3a4d69de"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#a8c3c34a78801711969e3199e3a4d69de">icu::CheckedArrayByteSink::NumberOfBytesAppended</a></div><div class="ttdeci">int32_t NumberOfBytesAppended() const</div><div class="ttdoc">Returns the number of bytes appended to the sink.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00248">bytestream.h:248</a></div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_ab1b0344012dae42c91b43b553a048eac"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#ab1b0344012dae42c91b43b553a048eac">icu::CheckedArrayByteSink::Overflowed</a></div><div class="ttdeci">UBool Overflowed() const</div><div class="ttdoc">Returns true if any bytes were discarded, i.e., if there was an attempt to write more than 'capacity'...</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00240">bytestream.h:240</a></div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_ac5b828c4a8c4d65fdca6860f02e72c89"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#ac5b828c4a8c4d65fdca6860f02e72c89">icu::CheckedArrayByteSink::Append</a></div><div class="ttdeci">virtual void Append(const char *bytes, int32_t n) override</div><div class="ttdoc">Append "bytes[0,n-1]" to this.</div></div>
<div class="ttc" id="aclassicu_1_1CheckedArrayByteSink_html_ad5728a62c5a1563dba0b2c26ebd3f907"><div class="ttname"><a href="classicu_1_1CheckedArrayByteSink.html#ad5728a62c5a1563dba0b2c26ebd3f907">icu::CheckedArrayByteSink::GetAppendBuffer</a></div><div class="ttdeci">virtual char * GetAppendBuffer(int32_t min_capacity, int32_t desired_capacity_hint, char *scratch, int32_t scratch_capacity, int32_t *result_capacity) override</div><div class="ttdoc">Returns a writable buffer for appending and writes the buffer's capacity to *result_capacity.</div></div>
<div class="ttc" id="aclassicu_1_1StringByteSink_html"><div class="ttname"><a href="classicu_1_1StringByteSink.html">icu::StringByteSink</a></div><div class="ttdoc">Implementation of ByteSink that writes to a "string".</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00267">bytestream.h:267</a></div></div>
<div class="ttc" id="aclassicu_1_1StringByteSink_html_a6bbb302649c70493ae10aec7831df7c7"><div class="ttname"><a href="classicu_1_1StringByteSink.html#a6bbb302649c70493ae10aec7831df7c7">icu::StringByteSink::StringByteSink</a></div><div class="ttdeci">StringByteSink(StringClass *dest, int32_t initialAppendCapacity)</div><div class="ttdoc">Constructs a ByteSink that reserves append capacity and will append bytes to the dest string.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00282">bytestream.h:282</a></div></div>
<div class="ttc" id="aclassicu_1_1StringByteSink_html_acf5001ee1201ba4821defafcc409250d"><div class="ttname"><a href="classicu_1_1StringByteSink.html#acf5001ee1201ba4821defafcc409250d">icu::StringByteSink::StringByteSink</a></div><div class="ttdeci">StringByteSink(StringClass *dest)</div><div class="ttdoc">Constructs a ByteSink that will append bytes to the dest string.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00274">bytestream.h:274</a></div></div>
<div class="ttc" id="aclassicu_1_1StringByteSink_html_ae452e5c53dc33bdcb83fbc27585264d0"><div class="ttname"><a href="classicu_1_1StringByteSink.html#ae452e5c53dc33bdcb83fbc27585264d0">icu::StringByteSink::Append</a></div><div class="ttdeci">virtual void Append(const char *data, int32_t n) override</div><div class="ttdoc">Append "bytes[0,n-1]" to this.</div><div class="ttdef"><b>Definition:</b> <a href="bytestream_8h_source.html#l00294">bytestream.h:294</a></div></div>
<div class="ttc" id="aclassicu_1_1UMemory_html"><div class="ttname"><a href="classicu_1_1UMemory.html">icu::UMemory</a></div><div class="ttdoc">UMemory is the common ICU base class.</div><div class="ttdef"><b>Definition:</b> <a href="uobject_8h_source.html#l00115">uobject.h:115</a></div></div>
<div class="ttc" id="astd__string_8h_html"><div class="ttname"><a href="std__string_8h.html">std_string.h</a></div><div class="ttdoc">C++ API: Central ICU header for including the C++ standard <string> header and for related definition...</div></div>
<div class="ttc" id="aumachine_8h_html_a349ef00011f20ccd1d3b424445681aa5"><div class="ttname"><a href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a></div><div class="ttdeci">int8_t UBool</div><div class="ttdoc">The ICU boolean type, a signed-byte integer.</div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00247">umachine.h:247</a></div></div>
<div class="ttc" id="auobject_8h_html"><div class="ttname"><a href="uobject_8h.html">uobject.h</a></div><div class="ttdoc">C++ API: Common ICU base class UObject.</div></div>
<div class="ttc" id="autypes_8h_html"><div class="ttname"><a href="utypes_8h.html">utypes.h</a></div><div class="ttdoc">Basic definitions for ICU, for both C and C++ APIs.</div></div>
<div class="ttc" id="autypes_8h_html_a559955ec3bc692657c5d8b1c6de8e334"><div class="ttname"><a href="utypes_8h.html#a559955ec3bc692657c5d8b1c6de8e334">U_COMMON_API</a></div><div class="ttdeci">#define U_COMMON_API</div><div class="ttdoc">Set to export library symbols from inside the common library, and to import them from outside.</div><div class="ttdef"><b>Definition:</b> <a href="utypes_8h_source.html#l00300">utypes.h:300</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>