]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/doc/requirements/SyncWriteStream.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / asio / doc / requirements / SyncWriteStream.qbk
1 [/
2 / Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
3 /
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 /]
7
8 [section:SyncWriteStream Buffer-oriented synchronous write stream requirements]
9
10 In the table below, `a` denotes a synchronous write stream object, `cb` denotes
11 an object satisfying [link boost_asio.reference.ConstBufferSequence constant
12 buffer sequence] requirements, and `ec` denotes an object of type `error_code`.
13
14 [table Buffer-oriented synchronous write stream requirements
15 [[operation] [type] [semantics, pre/post-conditions]]
16 [
17 [`a.write_some(cb);`]
18 [`size_t`]
19 [Equivalent to:
20 ``
21 error_code ec;
22 size_t s = a.write_some(cb, ec);
23 if (ec) throw system_error(ec);
24 return s;
25 ``]
26 ]
27 [
28 [`a.write_some(cb, ec);`]
29 [`size_t`]
30 [
31 Writes one or more bytes of data to the stream `a`.\n
32 \n
33 The constant buffer sequence `cb` specifies memory where the data to be
34 written is located. The `write_some` operation shall always write a
35 buffer in the sequence completely before proceeding to the next.\n
36 \n
37 If successful, returns the number of bytes written and sets `ec` such
38 that `!ec` is true. If an error occurred, returns `0` and sets `ec` such
39 that `!!ec` is true.\n
40 \n
41 If the total size of all buffers in the sequence `cb` is `0`, the
42 function shall return `0` immediately.
43 ]
44 ]
45 ]
46
47 [endsect]