aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/classwinapi_1_1Buffer.html
blob: 8c03e9c15aee3c75d7bd421b935c2c8827a71cef (plain) (tree)
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414





























































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                
<!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=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>winapi_common: winapi::Buffer 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 style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">winapi_common
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<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','.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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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"><b>winapi</b></li><li class="navelem"><a class="el" href="classwinapi_1_1Buffer.html">Buffer</a></li>  </ul>
</div>
</div><!-- top -->
<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="classwinapi_1_1Buffer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">winapi::Buffer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Binary data container.  
 <a href="classwinapi_1_1Buffer.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for winapi::Buffer:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classwinapi_1_1Buffer.png" alt=""/>
 </div></div>
<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:ad1e4d5da01f165bfbf5dee7cc811d4e6"><td class="memItemLeft" align="right" valign="top"><a id="ad1e4d5da01f165bfbf5dee7cc811d4e6"></a>
typedef std::vector&lt; unsigned char &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>Parent</b></td></tr>
<tr class="separator:ad1e4d5da01f165bfbf5dee7cc811d4e6"><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:abb43686e0f2e5798bc7b2c0e47722458"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#abb43686e0f2e5798bc7b2c0e47722458">Buffer</a> (std::initializer_list&lt; unsigned char &gt; lst)</td></tr>
<tr class="separator:abb43686e0f2e5798bc7b2c0e47722458"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46241e1fd3443c383c3930329ca9e0dd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#a46241e1fd3443c383c3930329ca9e0dd">Buffer</a> (Parent &amp;&amp;src)</td></tr>
<tr class="separator:a46241e1fd3443c383c3930329ca9e0dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3566a7ac7025a2f88abe116082b55a7"><td class="memTemplParams" colspan="2">template&lt;typename CharT &gt; </td></tr>
<tr class="memitem:aa3566a7ac7025a2f88abe116082b55a7"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#aa3566a7ac7025a2f88abe116082b55a7">Buffer</a> (const std::basic_string&lt; CharT &gt; &amp;src)</td></tr>
<tr class="separator:aa3566a7ac7025a2f88abe116082b55a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3649ebbd0cbc4b20d02b660a52be89c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#ab3649ebbd0cbc4b20d02b660a52be89c">Buffer</a> (const void *src, std::size_t nb)</td></tr>
<tr class="separator:ab3649ebbd0cbc4b20d02b660a52be89c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b2fad438202fbcfd4946baf3f879f59"><td class="memTemplParams" colspan="2">template&lt;typename CharT &gt; </td></tr>
<tr class="memitem:a0b2fad438202fbcfd4946baf3f879f59"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#a0b2fad438202fbcfd4946baf3f879f59">set</a> (const std::basic_string&lt; CharT &gt; &amp;src)</td></tr>
<tr class="separator:a0b2fad438202fbcfd4946baf3f879f59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab09aa9c5075579510da463b4148ee610"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#ab09aa9c5075579510da463b4148ee610">set</a> (const void *src, std::size_t nb)</td></tr>
<tr class="separator:ab09aa9c5075579510da463b4148ee610"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd8abcecacbcc9fdb4e5825068ebf561"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#afd8abcecacbcc9fdb4e5825068ebf561">as_utf8</a> () const</td></tr>
<tr class="separator:afd8abcecacbcc9fdb4e5825068ebf561"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5ca93f1935f2259db0d68e1884897d5"><td class="memItemLeft" align="right" valign="top">std::wstring&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#ac5ca93f1935f2259db0d68e1884897d5">as_utf16</a> () const</td></tr>
<tr class="separator:ac5ca93f1935f2259db0d68e1884897d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a303645b281fb4f1a4d9e84f1d1370182"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1Buffer.html#a303645b281fb4f1a4d9e84f1d1370182">add</a> (const <a class="el" href="classwinapi_1_1Buffer.html">Buffer</a> &amp;src)</td></tr>
<tr class="separator:a303645b281fb4f1a4d9e84f1d1370182"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Binary data container. </p>
<p>This class wraps a blob of binary data. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00024">24</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="abb43686e0f2e5798bc7b2c0e47722458"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abb43686e0f2e5798bc7b2c0e47722458">&#9670;&nbsp;</a></span>Buffer() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">winapi::Buffer::Buffer </td>
          <td>(</td>
          <td class="paramtype">std::initializer_list&lt; unsigned char &gt;&#160;</td>
          <td class="paramname"><em>lst</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a buffer from an explicit list of byte values. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00031">31</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="a46241e1fd3443c383c3930329ca9e0dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46241e1fd3443c383c3930329ca9e0dd">&#9670;&nbsp;</a></span>Buffer() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">winapi::Buffer::Buffer </td>
          <td>(</td>
          <td class="paramtype">Parent &amp;&amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a buffer from an instance of <code>std::vector&lt;unsigned char&gt;</code>. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00034">34</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="aa3566a7ac7025a2f88abe116082b55a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3566a7ac7025a2f88abe116082b55a7">&#9670;&nbsp;</a></span>Buffer() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">winapi::Buffer::Buffer </td>
          <td>(</td>
          <td class="paramtype">const std::basic_string&lt; CharT &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a buffer from an instance of <code>std::basic_string</code>. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00038">38</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="ab3649ebbd0cbc4b20d02b660a52be89c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3649ebbd0cbc4b20d02b660a52be89c">&#9670;&nbsp;</a></span>Buffer() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">winapi::Buffer::Buffer </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>nb</em>&#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">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Construct a buffer from a memory region. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00043">43</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a0b2fad438202fbcfd4946baf3f879f59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b2fad438202fbcfd4946baf3f879f59">&#9670;&nbsp;</a></span>set() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CharT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void winapi::Buffer::set </td>
          <td>(</td>
          <td class="paramtype">const std::basic_string&lt; CharT &gt; &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Replace the buffer's contents with the data from <code>std::basic_string</code>. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00047">47</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="ab09aa9c5075579510da463b4148ee610"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab09aa9c5075579510da463b4148ee610">&#9670;&nbsp;</a></span>set() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void winapi::Buffer::set </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>nb</em>&#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">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Replace the buffer's contents with the data from a memory region. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00052">52</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="afd8abcecacbcc9fdb4e5825068ebf561"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd8abcecacbcc9fdb4e5825068ebf561">&#9670;&nbsp;</a></span>as_utf8()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string winapi::Buffer::as_utf8 </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Interpret the buffer's contents as a <code>std::string</code>. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00058">58</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="ac5ca93f1935f2259db0d68e1884897d5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5ca93f1935f2259db0d68e1884897d5">&#9670;&nbsp;</a></span>as_utf16()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::wstring winapi::Buffer::as_utf16 </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Interpret the buffer's contents as a <code>std::wstring</code>. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00066">66</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<a id="a303645b281fb4f1a4d9e84f1d1370182"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a303645b281fb4f1a4d9e84f1d1370182">&#9670;&nbsp;</a></span>add()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void winapi::Buffer::add </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwinapi_1_1Buffer.html">Buffer</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Append another buffer to the end of this one. </p>

<p class="definition">Definition at line <a class="el" href="buffer_8hpp_source.html#l00079">79</a> of file <a class="el" href="buffer_8hpp_source.html">buffer.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/winapi/<a class="el" href="buffer_8hpp_source.html">buffer.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>