• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>http::file_body</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
8<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
9<link rel="prev" href="boost__beast__http__fields.html" title="http::fields">
10<link rel="next" href="boost__beast__http__request_header.html" title="http::request_header">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="boost__beast__http__fields.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__request_header.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h4 class="title">
27<a name="beast.ref.boost__beast__http__file_body"></a><a class="link" href="boost__beast__http__file_body.html" title="http::file_body">http::file_body</a>
28</h4></div></div></div>
29<p>
30        <a class="indexterm" name="idm46057508843696"></a>
31      </p>
32<p>
33        A message body represented by a file on the filesystem.
34      </p>
35<h5>
36<a name="beast.ref.boost__beast__http__file_body.h0"></a>
37        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.synopsis"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.synopsis">Synopsis</a>
38      </h5>
39<p>
40        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/file_body.hpp" target="_top">boost/beast/http/file_body.hpp</a>&gt;</code>
41      </p>
42<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">file_body</span> <span class="special">=</span> <span class="identifier">basic_file_body</span><span class="special">&lt;</span> <span class="identifier">file</span> <span class="special">&gt;;</span>
43</pre>
44<h5>
45<a name="beast.ref.boost__beast__http__file_body.h1"></a>
46        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.types"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.types">Types</a>
47      </h5>
48<div class="informaltable"><table class="table">
49<colgroup>
50<col>
51<col>
52</colgroup>
53<thead><tr>
54<th>
55                <p>
56                  Name
57                </p>
58              </th>
59<th>
60                <p>
61                  Description
62                </p>
63              </th>
64</tr></thead>
65<tbody>
66<tr>
67<td>
68                <p>
69                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body/file_type.html" title="http::basic_file_body::file_type">file_type</a></strong></span>
70                </p>
71              </td>
72<td>
73                <p>
74                  The type of File this body uses.
75                </p>
76              </td>
77</tr>
78<tr>
79<td>
80                <p>
81                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body__reader.html" title="http::basic_file_body::reader">reader</a></strong></span>
82                </p>
83              </td>
84<td>
85                <p>
86                  Algorithm for storing buffers when parsing.
87                </p>
88              </td>
89</tr>
90<tr>
91<td>
92                <p>
93                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body__value_type.html" title="http::basic_file_body::value_type">value_type</a></strong></span>
94                </p>
95              </td>
96<td>
97                <p>
98                  The type of the <a class="link" href="boost__beast__http__message/body/overload1.html" title="http::message::body (1 of 3 overloads)"><code class="computeroutput"><span class="identifier">message</span><span class="special">::</span><span class="identifier">body</span></code></a> member.
99                </p>
100              </td>
101</tr>
102<tr>
103<td>
104                <p>
105                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body__writer.html" title="http::basic_file_body::writer">writer</a></strong></span>
106                </p>
107              </td>
108<td>
109                <p>
110                  Algorithm for retrieving buffers when serializing.
111                </p>
112              </td>
113</tr>
114</tbody>
115</table></div>
116<h5>
117<a name="beast.ref.boost__beast__http__file_body.h2"></a>
118        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.member_functions"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.member_functions">Member
119        Functions</a>
120      </h5>
121<div class="informaltable"><table class="table">
122<colgroup>
123<col>
124<col>
125</colgroup>
126<thead><tr>
127<th>
128                <p>
129                  Name
130                </p>
131              </th>
132<th>
133                <p>
134                  Description
135                </p>
136              </th>
137</tr></thead>
138<tbody><tr>
139<td>
140                <p>
141                  <span class="bold"><strong><a class="link" href="boost__beast__http__basic_file_body/size.html" title="http::basic_file_body::size">size</a></strong></span>
142                </p>
143              </td>
144<td>
145                <p>
146                  Returns the size of the body.
147                </p>
148              </td>
149</tr></tbody>
150</table></div>
151<p>
152        Messages with this type have bodies represented by a file on the file system.
153        When parsing a message using this body type, the data is stored in the file
154        pointed to by the path, which must be writable. When serializing, the implementation
155        will read the file and present those octets as the body content. This may
156        be used to serve content from a directory as part of a web service.
157      </p>
158<h5>
159<a name="beast.ref.boost__beast__http__file_body.h3"></a>
160        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.template_parameters"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.template_parameters">Template
161        Parameters</a>
162      </h5>
163<div class="informaltable"><table class="table">
164<colgroup>
165<col>
166<col>
167</colgroup>
168<thead><tr>
169<th>
170                <p>
171                  Type
172                </p>
173              </th>
174<th>
175                <p>
176                  Description
177                </p>
178              </th>
179</tr></thead>
180<tbody><tr>
181<td>
182                <p>
183                  <code class="computeroutput"><span class="identifier">File</span></code>
184                </p>
185              </td>
186<td>
187                <p>
188                  The implementation to use for accessing files. This type must meet
189                  the requirements of <span class="emphasis"><em>File</em></span>.
190                </p>
191              </td>
192</tr></tbody>
193</table></div>
194<h5>
195<a name="beast.ref.boost__beast__http__file_body.h4"></a>
196        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.types0"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.types0">Types</a>
197      </h5>
198<div class="informaltable"><table class="table">
199<colgroup>
200<col>
201<col>
202</colgroup>
203<thead><tr>
204<th>
205                <p>
206                  Name
207                </p>
208              </th>
209<th>
210                <p>
211                  Description
212                </p>
213              </th>
214</tr></thead>
215<tbody><tr>
216<td>
217                <p>
218                  <span class="bold"><strong><a class="link" href="boost__beast__file/native_handle_type.html" title="file::native_handle_type">native_handle_type</a></strong></span>
219                </p>
220              </td>
221<td>
222                <p>
223                  The type of the underlying file handle.
224                </p>
225              </td>
226</tr></tbody>
227</table></div>
228<h5>
229<a name="beast.ref.boost__beast__http__file_body.h5"></a>
230        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.member_functions0"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.member_functions0">Member
231        Functions</a>
232      </h5>
233<div class="informaltable"><table class="table">
234<colgroup>
235<col>
236<col>
237</colgroup>
238<thead><tr>
239<th>
240                <p>
241                  Name
242                </p>
243              </th>
244<th>
245                <p>
246                  Description
247                </p>
248              </th>
249</tr></thead>
250<tbody>
251<tr>
252<td>
253                <p>
254                  <span class="bold"><strong><a class="link" href="boost__beast__file/close.html" title="file::close">close</a></strong></span>
255                </p>
256              </td>
257<td>
258                <p>
259                  Close the file if open.
260                </p>
261              </td>
262</tr>
263<tr>
264<td>
265                <p>
266                  <span class="bold"><strong><a class="link" href="boost__beast__file/is_open.html" title="file::is_open">is_open</a></strong></span>
267                </p>
268              </td>
269<td>
270                <p>
271                  Returns <code class="computeroutput"><span class="keyword">true</span></code> if the
272                  file is open.
273                </p>
274              </td>
275</tr>
276<tr>
277<td>
278                <p>
279                  <span class="bold"><strong><a class="link" href="boost__beast__file/native_handle.html" title="file::native_handle">native_handle</a></strong></span>
280                </p>
281              </td>
282<td>
283                <p>
284                  Returns the native handle associated with the file.
285                </p>
286                <p>
287                  Set the native handle associated with the file.
288                </p>
289              </td>
290</tr>
291<tr>
292<td>
293                <p>
294                  <span class="bold"><strong><a class="link" href="boost__beast__file/open.html" title="file::open">open</a></strong></span>
295                </p>
296              </td>
297<td>
298                <p>
299                  Open a file at the given path with the specified mode.
300                </p>
301              </td>
302</tr>
303<tr>
304<td>
305                <p>
306                  <span class="bold"><strong><a class="link" href="boost__beast__file/pos.html" title="file::pos">pos</a></strong></span>
307                </p>
308              </td>
309<td>
310                <p>
311                  Return the current position in the open file.
312                </p>
313              </td>
314</tr>
315<tr>
316<td>
317                <p>
318                  <span class="bold"><strong><a class="link" href="boost__beast__file/read.html" title="file::read">read</a></strong></span>
319                </p>
320              </td>
321<td>
322                <p>
323                  Read from the open file.
324                </p>
325              </td>
326</tr>
327<tr>
328<td>
329                <p>
330                  <span class="bold"><strong><a class="link" href="boost__beast__file/seek.html" title="file::seek">seek</a></strong></span>
331                </p>
332              </td>
333<td>
334                <p>
335                  Adjust the current position in the open file.
336                </p>
337              </td>
338</tr>
339<tr>
340<td>
341                <p>
342                  <span class="bold"><strong><a class="link" href="boost__beast__file/size.html" title="file::size">size</a></strong></span>
343                </p>
344              </td>
345<td>
346                <p>
347                  Return the size of the open file.
348                </p>
349              </td>
350</tr>
351<tr>
352<td>
353                <p>
354                  <span class="bold"><strong><a class="link" href="boost__beast__file/write.html" title="file::write">write</a></strong></span>
355                </p>
356              </td>
357<td>
358                <p>
359                  Write to the open file.
360                </p>
361              </td>
362</tr>
363</tbody>
364</table></div>
365<p>
366        This alias is set to the best available implementation of <span class="emphasis"><em>File</em></span>
367        given the platform and build settings.
368      </p>
369<h5>
370<a name="beast.ref.boost__beast__http__file_body.h6"></a>
371        <span class="phrase"><a name="beast.ref.boost__beast__http__file_body.description"></a></span><a class="link" href="boost__beast__http__file_body.html#beast.ref.boost__beast__http__file_body.description">Description</a>
372      </h5>
373</div>
374<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
375<td align="left"></td>
376<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
377      Falco<p>
378        Distributed under the Boost Software License, Version 1.0. (See accompanying
379        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
380      </p>
381</div></td>
382</tr></table>
383<hr>
384<div class="spirit-nav">
385<a accesskey="p" href="boost__beast__http__fields.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__request_header.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
386</div>
387</body>
388</html>
389