forked from unicode-org/icu-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclassBytesTrieBuilder.html
359 lines (333 loc) · 25.8 KB
/
classBytesTrieBuilder.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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!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: icu::BytesTrieBuilder 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/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="namespaceicu.html">icu</a></li><li class="navelem"><a class="el" href="classicu_1_1BytesTrieBuilder.html">BytesTrieBuilder</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#friends">Friends</a> </div>
<div class="headertitle"><div class="title">icu::BytesTrieBuilder Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Builder class for <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a>.
<a href="classicu_1_1BytesTrieBuilder.html#details">More...</a></p>
<p><code>#include <<a class="el" href="bytestriebuilder_8h_source.html">bytestriebuilder.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for icu::BytesTrieBuilder:</div>
<div class="dyncontent">
<div class="center">
<img src="classicu_1_1BytesTrieBuilder.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a36f4bdebf1028359705ca1467da7bf2e"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#a36f4bdebf1028359705ca1467da7bf2e">BytesTrieBuilder</a> (<a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &errorCode)</td></tr>
<tr class="memdesc:a36f4bdebf1028359705ca1467da7bf2e"><td class="mdescLeft"> </td><td class="mdescRight">Constructs an empty builder. <a href="classicu_1_1BytesTrieBuilder.html#a36f4bdebf1028359705ca1467da7bf2e">More...</a><br /></td></tr>
<tr class="separator:a36f4bdebf1028359705ca1467da7bf2e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a854862c66e6db2302ac8d477cabffd1b"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#a854862c66e6db2302ac8d477cabffd1b">~BytesTrieBuilder</a> ()</td></tr>
<tr class="memdesc:a854862c66e6db2302ac8d477cabffd1b"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="classicu_1_1BytesTrieBuilder.html#a854862c66e6db2302ac8d477cabffd1b">More...</a><br /></td></tr>
<tr class="separator:a854862c66e6db2302ac8d477cabffd1b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0a1aaa7aa3dccd06866455c2a4eefad0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1BytesTrieBuilder.html">BytesTrieBuilder</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0">add</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> s, int32_t value, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &errorCode)</td></tr>
<tr class="memdesc:a0a1aaa7aa3dccd06866455c2a4eefad0"><td class="mdescLeft"> </td><td class="mdescRight">Adds a (byte sequence, value) pair. <a href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0">More...</a><br /></td></tr>
<tr class="separator:a0a1aaa7aa3dccd06866455c2a4eefad0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a30966e27055e9baeb8d63548f8ee21ee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1BytesTrie.html">BytesTrie</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee">build</a> (<a class="el" href="stringtriebuilder_8h.html#ab557ad2f18077945b8b81cf44a9233e5">UStringTrieBuildOption</a> buildOption, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &errorCode)</td></tr>
<tr class="memdesc:a30966e27055e9baeb8d63548f8ee21ee"><td class="mdescLeft"> </td><td class="mdescRight">Builds a <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> for the <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed data. <a href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee">More...</a><br /></td></tr>
<tr class="separator:a30966e27055e9baeb8d63548f8ee21ee"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2dc5080052f771043674930eae602f60"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#a2dc5080052f771043674930eae602f60">buildStringPiece</a> (<a class="el" href="stringtriebuilder_8h.html#ab557ad2f18077945b8b81cf44a9233e5">UStringTrieBuildOption</a> buildOption, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &errorCode)</td></tr>
<tr class="memdesc:a2dc5080052f771043674930eae602f60"><td class="mdescLeft"> </td><td class="mdescRight">Builds a <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> for the <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed data and byte-serializes it. <a href="classicu_1_1BytesTrieBuilder.html#a2dc5080052f771043674930eae602f60">More...</a><br /></td></tr>
<tr class="separator:a2dc5080052f771043674930eae602f60"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad7235e5f67e4c691fea54e07e6b18e74"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1BytesTrieBuilder.html">BytesTrieBuilder</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#ad7235e5f67e4c691fea54e07e6b18e74">clear</a> ()</td></tr>
<tr class="memdesc:ad7235e5f67e4c691fea54e07e6b18e74"><td class="mdescLeft"> </td><td class="mdescRight">Removes all (byte sequence, value) pairs. <a href="classicu_1_1BytesTrieBuilder.html#ad7235e5f67e4c691fea54e07e6b18e74">More...</a><br /></td></tr>
<tr class="separator:ad7235e5f67e4c691fea54e07e6b18e74"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="friends" name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:af14dbed26f3ba3c9c0f19215dcd807c0"><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1BytesTrieBuilder.html#af14dbed26f3ba3c9c0f19215dcd807c0">::BytesTrieTest</a></td></tr>
<tr class="separator:af14dbed26f3ba3c9c0f19215dcd807c0"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Builder class for <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a>. </p>
<p >This class is not intended for public subclassing. </p><dl class="stable"><dt><b><a class="el" href="stable.html#_stable000098">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
<p class="definition">Definition at line <a class="el" href="bytestriebuilder_8h_source.html#l00045">45</a> of file <a class="el" href="bytestriebuilder_8h_source.html">bytestriebuilder.h</a>.</p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a36f4bdebf1028359705ca1467da7bf2e" name="a36f4bdebf1028359705ca1467da7bf2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36f4bdebf1028359705ca1467da7bf2e">◆ </a></span>BytesTrieBuilder()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">icu::BytesTrieBuilder::BytesTrieBuilder </td>
<td>(</td>
<td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td>
<td class="paramname"><em>errorCode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs an empty builder. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">errorCode</td><td>Standard ICU error code. </td></tr>
</table>
</dd>
</dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000099">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
</div>
</div>
<a id="a854862c66e6db2302ac8d477cabffd1b" name="a854862c66e6db2302ac8d477cabffd1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a854862c66e6db2302ac8d477cabffd1b">◆ </a></span>~BytesTrieBuilder()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual icu::BytesTrieBuilder::~BytesTrieBuilder </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000100">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a0a1aaa7aa3dccd06866455c2a4eefad0" name="a0a1aaa7aa3dccd06866455c2a4eefad0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a1aaa7aa3dccd06866455c2a4eefad0">◆ </a></span>add()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classicu_1_1BytesTrieBuilder.html">BytesTrieBuilder</a> & icu::BytesTrieBuilder::add </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int32_t </td>
<td class="paramname"><em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td>
<td class="paramname"><em>errorCode</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds a (byte sequence, value) pair. </p>
<p >The byte sequence must be unique. The bytes will be copied; the builder does not keep a reference to the input <a class="el" href="classicu_1_1StringPiece.html" title="A string-like object that points to a sized piece of memory.">StringPiece</a> or its data(). </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">s</td><td>The input byte sequence. </td></tr>
<tr><td class="paramname">value</td><td>The value associated with this byte sequence. </td></tr>
<tr><td class="paramname">errorCode</td><td>Standard ICU error code. Its input value must pass the <a class="el" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711" title="Does the error code indicate success?">U_SUCCESS()</a> test, or else the function returns immediately. Check for <a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure?">U_FAILURE()</a> on output or use with function chaining. (See User Guide for details.) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>*this </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000101">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
</div>
</div>
<a id="a30966e27055e9baeb8d63548f8ee21ee" name="a30966e27055e9baeb8d63548f8ee21ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a30966e27055e9baeb8d63548f8ee21ee">◆ </a></span>build()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classicu_1_1BytesTrie.html">BytesTrie</a> * icu::BytesTrieBuilder::build </td>
<td>(</td>
<td class="paramtype"><a class="el" href="stringtriebuilder_8h.html#ab557ad2f18077945b8b81cf44a9233e5">UStringTrieBuildOption</a> </td>
<td class="paramname"><em>buildOption</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td>
<td class="paramname"><em>errorCode</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Builds a <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> for the <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed data. </p>
<p >Once built, no further data can be <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed until <a class="el" href="classicu_1_1BytesTrieBuilder.html#ad7235e5f67e4c691fea54e07e6b18e74" title="Removes all (byte sequence, value) pairs.">clear()</a> is called.</p>
<p >A <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> cannot be empty. At least one (byte sequence, value) pair must have been <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed.</p>
<p >This method passes ownership of the builder's internal result array to the new trie object. Another call to any <a class="el" href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee" title="Builds a BytesTrie for the add()ed data.">build()</a> variant will re-serialize the trie. After <a class="el" href="classicu_1_1BytesTrieBuilder.html#ad7235e5f67e4c691fea54e07e6b18e74" title="Removes all (byte sequence, value) pairs.">clear()</a> has been called, a new array will be used as well. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buildOption</td><td>Build option, see UStringTrieBuildOption. </td></tr>
<tr><td class="paramname">errorCode</td><td>Standard ICU error code. Its input value must pass the <a class="el" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711" title="Does the error code indicate success?">U_SUCCESS()</a> test, or else the function returns immediately. Check for <a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure?">U_FAILURE()</a> on output or use with function chaining. (See User Guide for details.) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A new <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> for the <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed data. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000102">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
</div>
</div>
<a id="a2dc5080052f771043674930eae602f60" name="a2dc5080052f771043674930eae602f60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2dc5080052f771043674930eae602f60">◆ </a></span>buildStringPiece()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> icu::BytesTrieBuilder::buildStringPiece </td>
<td>(</td>
<td class="paramtype"><a class="el" href="stringtriebuilder_8h.html#ab557ad2f18077945b8b81cf44a9233e5">UStringTrieBuildOption</a> </td>
<td class="paramname"><em>buildOption</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & </td>
<td class="paramname"><em>errorCode</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Builds a <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> for the <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed data and byte-serializes it. </p>
<p >Once built, no further data can be <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed until <a class="el" href="classicu_1_1BytesTrieBuilder.html#ad7235e5f67e4c691fea54e07e6b18e74" title="Removes all (byte sequence, value) pairs.">clear()</a> is called.</p>
<p >A <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> cannot be empty. At least one (byte sequence, value) pair must have been <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed.</p>
<p >Multiple calls to <a class="el" href="classicu_1_1BytesTrieBuilder.html#a2dc5080052f771043674930eae602f60" title="Builds a BytesTrie for the add()ed data and byte-serializes it.">buildStringPiece()</a> return StringPieces referring to the builder's same byte array, without rebuilding. If <a class="el" href="classicu_1_1BytesTrieBuilder.html#a2dc5080052f771043674930eae602f60" title="Builds a BytesTrie for the add()ed data and byte-serializes it.">buildStringPiece()</a> is called after <a class="el" href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee" title="Builds a BytesTrie for the add()ed data.">build()</a>, the trie will be re-serialized into a new array (because <a class="el" href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee" title="Builds a BytesTrie for the add()ed data.">build()</a> passes on ownership). If <a class="el" href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee" title="Builds a BytesTrie for the add()ed data.">build()</a> is called after <a class="el" href="classicu_1_1BytesTrieBuilder.html#a2dc5080052f771043674930eae602f60" title="Builds a BytesTrie for the add()ed data and byte-serializes it.">buildStringPiece()</a>, the trie object returned by <a class="el" href="classicu_1_1BytesTrieBuilder.html#a30966e27055e9baeb8d63548f8ee21ee" title="Builds a BytesTrie for the add()ed data.">build()</a> will become the owner of the underlying string for the previously returned <a class="el" href="classicu_1_1StringPiece.html" title="A string-like object that points to a sized piece of memory.">StringPiece</a>. After <a class="el" href="classicu_1_1BytesTrieBuilder.html#ad7235e5f67e4c691fea54e07e6b18e74" title="Removes all (byte sequence, value) pairs.">clear()</a> has been called, a new array will be used as well. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buildOption</td><td>Build option, see UStringTrieBuildOption. </td></tr>
<tr><td class="paramname">errorCode</td><td>Standard ICU error code. Its input value must pass the <a class="el" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711" title="Does the error code indicate success?">U_SUCCESS()</a> test, or else the function returns immediately. Check for <a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure?">U_FAILURE()</a> on output or use with function chaining. (See User Guide for details.) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="classicu_1_1StringPiece.html" title="A string-like object that points to a sized piece of memory.">StringPiece</a> which refers to the byte-serialized <a class="el" href="classicu_1_1BytesTrie.html" title="Light-weight, non-const reader class for a BytesTrie.">BytesTrie</a> for the <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed data. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000103">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
</div>
</div>
<a id="ad7235e5f67e4c691fea54e07e6b18e74" name="ad7235e5f67e4c691fea54e07e6b18e74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad7235e5f67e4c691fea54e07e6b18e74">◆ </a></span>clear()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classicu_1_1BytesTrieBuilder.html">BytesTrieBuilder</a> & icu::BytesTrieBuilder::clear </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes all (byte sequence, value) pairs. </p>
<p >New data can then be <a class="el" href="classicu_1_1BytesTrieBuilder.html#a0a1aaa7aa3dccd06866455c2a4eefad0" title="Adds a (byte sequence, value) pair.">add()</a>ed and a new trie can be built. </p><dl class="section return"><dt>Returns</dt><dd>*this </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000104">Stable:</a></b></dt><dd>ICU 4.8 </dd></dl>
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="af14dbed26f3ba3c9c0f19215dcd807c0" name="af14dbed26f3ba3c9c0f19215dcd807c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af14dbed26f3ba3c9c0f19215dcd807c0">◆ </a></span>::BytesTrieTest</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">friend class ::BytesTrieTest</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="bytestriebuilder_8h_source.html#l00130">130</a> of file <a class="el" href="bytestriebuilder_8h_source.html">bytestriebuilder.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>common/unicode/<a class="el" href="bytestriebuilder_8h_source.html">bytestriebuilder.h</a></li>
</ul>
</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>