5 // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_WRITE_AT_HPP
12 #define BOOST_ASIO_WRITE_AT_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #include <boost/asio/async_result.hpp>
21 #include <boost/asio/detail/cstdint.hpp>
22 #include <boost/asio/error.hpp>
24 #if !defined(BOOST_ASIO_NO_EXTENSIONS)
25 # include <boost/asio/basic_streambuf_fwd.hpp>
26 #endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
28 #include <boost/asio/detail/push_options.hpp>
34 * @defgroup write_at boost::asio::write_at
36 * @brief The @c write_at function is a composed operation that writes a
37 * certain amount of data at a specified offset before returning.
41 /// Write all of the supplied data at the specified offset before returning.
43 * This function is used to write a certain number of bytes of data to a random
44 * access device at a specified offset. The call will block until one of the
45 * following conditions is true:
47 * @li All of the data in the supplied buffers has been written. That is, the
48 * bytes transferred is equal to the sum of the buffer sizes.
50 * @li An error occurred.
52 * This operation is implemented in terms of zero or more calls to the device's
53 * write_some_at function.
55 * @param d The device to which the data is to be written. The type must support
56 * the SyncRandomAccessWriteDevice concept.
58 * @param offset The offset at which the data will be written.
60 * @param buffers One or more buffers containing the data to be written. The sum
61 * of the buffer sizes indicates the maximum number of bytes to write to the
64 * @returns The number of bytes transferred.
66 * @throws boost::system::system_error Thrown on failure.
69 * To write a single data buffer use the @ref buffer function as follows:
70 * @code boost::asio::write_at(d, 42, boost::asio::buffer(data, size)); @endcode
71 * See the @ref buffer documentation for information on writing multiple
72 * buffers in one go, and how to use it with arrays, boost::array or
75 * @note This overload is equivalent to calling:
76 * @code boost::asio::write_at(
78 * boost::asio::transfer_all()); @endcode
80 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
81 std::size_t write_at(SyncRandomAccessWriteDevice& d,
82 uint64_t offset, const ConstBufferSequence& buffers);
84 /// Write all of the supplied data at the specified offset before returning.
86 * This function is used to write a certain number of bytes of data to a random
87 * access device at a specified offset. The call will block until one of the
88 * following conditions is true:
90 * @li All of the data in the supplied buffers has been written. That is, the
91 * bytes transferred is equal to the sum of the buffer sizes.
93 * @li An error occurred.
95 * This operation is implemented in terms of zero or more calls to the device's
96 * write_some_at function.
98 * @param d The device to which the data is to be written. The type must support
99 * the SyncRandomAccessWriteDevice concept.
101 * @param offset The offset at which the data will be written.
103 * @param buffers One or more buffers containing the data to be written. The sum
104 * of the buffer sizes indicates the maximum number of bytes to write to the
107 * @param ec Set to indicate what error occurred, if any.
109 * @returns The number of bytes transferred.
112 * To write a single data buffer use the @ref buffer function as follows:
113 * @code boost::asio::write_at(d, 42,
114 * boost::asio::buffer(data, size), ec); @endcode
115 * See the @ref buffer documentation for information on writing multiple
116 * buffers in one go, and how to use it with arrays, boost::array or
119 * @note This overload is equivalent to calling:
120 * @code boost::asio::write_at(
121 * d, offset, buffers,
122 * boost::asio::transfer_all(), ec); @endcode
124 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
125 std::size_t write_at(SyncRandomAccessWriteDevice& d,
126 uint64_t offset, const ConstBufferSequence& buffers,
127 boost::system::error_code& ec);
129 /// Write a certain amount of data at a specified offset before returning.
131 * This function is used to write a certain number of bytes of data to a random
132 * access device at a specified offset. The call will block until one of the
133 * following conditions is true:
135 * @li All of the data in the supplied buffers has been written. That is, the
136 * bytes transferred is equal to the sum of the buffer sizes.
138 * @li The completion_condition function object returns 0.
140 * This operation is implemented in terms of zero or more calls to the device's
141 * write_some_at function.
143 * @param d The device to which the data is to be written. The type must support
144 * the SyncRandomAccessWriteDevice concept.
146 * @param offset The offset at which the data will be written.
148 * @param buffers One or more buffers containing the data to be written. The sum
149 * of the buffer sizes indicates the maximum number of bytes to write to the
152 * @param completion_condition The function object to be called to determine
153 * whether the write operation is complete. The signature of the function object
155 * @code std::size_t completion_condition(
156 * // Result of latest write_some_at operation.
157 * const boost::system::error_code& error,
159 * // Number of bytes transferred so far.
160 * std::size_t bytes_transferred
162 * A return value of 0 indicates that the write operation is complete. A
163 * non-zero return value indicates the maximum number of bytes to be written on
164 * the next call to the device's write_some_at function.
166 * @returns The number of bytes transferred.
168 * @throws boost::system::system_error Thrown on failure.
171 * To write a single data buffer use the @ref buffer function as follows:
172 * @code boost::asio::write_at(d, 42, boost::asio::buffer(data, size),
173 * boost::asio::transfer_at_least(32)); @endcode
174 * See the @ref buffer documentation for information on writing multiple
175 * buffers in one go, and how to use it with arrays, boost::array or
178 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
179 typename CompletionCondition>
180 std::size_t write_at(SyncRandomAccessWriteDevice& d,
181 uint64_t offset, const ConstBufferSequence& buffers,
182 CompletionCondition completion_condition);
184 /// Write a certain amount of data at a specified offset before returning.
186 * This function is used to write a certain number of bytes of data to a random
187 * access device at a specified offset. The call will block until one of the
188 * following conditions is true:
190 * @li All of the data in the supplied buffers has been written. That is, the
191 * bytes transferred is equal to the sum of the buffer sizes.
193 * @li The completion_condition function object returns 0.
195 * This operation is implemented in terms of zero or more calls to the device's
196 * write_some_at function.
198 * @param d The device to which the data is to be written. The type must support
199 * the SyncRandomAccessWriteDevice concept.
201 * @param offset The offset at which the data will be written.
203 * @param buffers One or more buffers containing the data to be written. The sum
204 * of the buffer sizes indicates the maximum number of bytes to write to the
207 * @param completion_condition The function object to be called to determine
208 * whether the write operation is complete. The signature of the function object
210 * @code std::size_t completion_condition(
211 * // Result of latest write_some_at operation.
212 * const boost::system::error_code& error,
214 * // Number of bytes transferred so far.
215 * std::size_t bytes_transferred
217 * A return value of 0 indicates that the write operation is complete. A
218 * non-zero return value indicates the maximum number of bytes to be written on
219 * the next call to the device's write_some_at function.
221 * @param ec Set to indicate what error occurred, if any.
223 * @returns The number of bytes written. If an error occurs, returns the total
224 * number of bytes successfully transferred prior to the error.
226 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
227 typename CompletionCondition>
228 std::size_t write_at(SyncRandomAccessWriteDevice& d,
229 uint64_t offset, const ConstBufferSequence& buffers,
230 CompletionCondition completion_condition, boost::system::error_code& ec);
232 #if !defined(BOOST_ASIO_NO_EXTENSIONS)
233 #if !defined(BOOST_ASIO_NO_IOSTREAM)
235 /// Write all of the supplied data at the specified offset before returning.
237 * This function is used to write a certain number of bytes of data to a random
238 * access device at a specified offset. The call will block until one of the
239 * following conditions is true:
241 * @li All of the data in the supplied basic_streambuf has been written.
243 * @li An error occurred.
245 * This operation is implemented in terms of zero or more calls to the device's
246 * write_some_at function.
248 * @param d The device to which the data is to be written. The type must support
249 * the SyncRandomAccessWriteDevice concept.
251 * @param offset The offset at which the data will be written.
253 * @param b The basic_streambuf object from which data will be written.
255 * @returns The number of bytes transferred.
257 * @throws boost::system::system_error Thrown on failure.
259 * @note This overload is equivalent to calling:
260 * @code boost::asio::write_at(
262 * boost::asio::transfer_all()); @endcode
264 template <typename SyncRandomAccessWriteDevice, typename Allocator>
265 std::size_t write_at(SyncRandomAccessWriteDevice& d,
266 uint64_t offset, basic_streambuf<Allocator>& b);
268 /// Write all of the supplied data at the specified offset before returning.
270 * This function is used to write a certain number of bytes of data to a random
271 * access device at a specified offset. The call will block until one of the
272 * following conditions is true:
274 * @li All of the data in the supplied basic_streambuf has been written.
276 * @li An error occurred.
278 * This operation is implemented in terms of zero or more calls to the device's
279 * write_some_at function.
281 * @param d The device to which the data is to be written. The type must support
282 * the SyncRandomAccessWriteDevice concept.
284 * @param offset The offset at which the data will be written.
286 * @param b The basic_streambuf object from which data will be written.
288 * @param ec Set to indicate what error occurred, if any.
290 * @returns The number of bytes transferred.
292 * @note This overload is equivalent to calling:
293 * @code boost::asio::write_at(
295 * boost::asio::transfer_all(), ec); @endcode
297 template <typename SyncRandomAccessWriteDevice, typename Allocator>
298 std::size_t write_at(SyncRandomAccessWriteDevice& d,
299 uint64_t offset, basic_streambuf<Allocator>& b,
300 boost::system::error_code& ec);
302 /// Write a certain amount of data at a specified offset before returning.
304 * This function is used to write a certain number of bytes of data to a random
305 * access device at a specified offset. The call will block until one of the
306 * following conditions is true:
308 * @li All of the data in the supplied basic_streambuf has been written.
310 * @li The completion_condition function object returns 0.
312 * This operation is implemented in terms of zero or more calls to the device's
313 * write_some_at function.
315 * @param d The device to which the data is to be written. The type must support
316 * the SyncRandomAccessWriteDevice concept.
318 * @param offset The offset at which the data will be written.
320 * @param b The basic_streambuf object from which data will be written.
322 * @param completion_condition The function object to be called to determine
323 * whether the write operation is complete. The signature of the function object
325 * @code std::size_t completion_condition(
326 * // Result of latest write_some_at operation.
327 * const boost::system::error_code& error,
329 * // Number of bytes transferred so far.
330 * std::size_t bytes_transferred
332 * A return value of 0 indicates that the write operation is complete. A
333 * non-zero return value indicates the maximum number of bytes to be written on
334 * the next call to the device's write_some_at function.
336 * @returns The number of bytes transferred.
338 * @throws boost::system::system_error Thrown on failure.
340 template <typename SyncRandomAccessWriteDevice, typename Allocator,
341 typename CompletionCondition>
342 std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
343 basic_streambuf<Allocator>& b, CompletionCondition completion_condition);
345 /// Write a certain amount of data at a specified offset before returning.
347 * This function is used to write a certain number of bytes of data to a random
348 * access device at a specified offset. The call will block until one of the
349 * following conditions is true:
351 * @li All of the data in the supplied basic_streambuf has been written.
353 * @li The completion_condition function object returns 0.
355 * This operation is implemented in terms of zero or more calls to the device's
356 * write_some_at function.
358 * @param d The device to which the data is to be written. The type must support
359 * the SyncRandomAccessWriteDevice concept.
361 * @param offset The offset at which the data will be written.
363 * @param b The basic_streambuf object from which data will be written.
365 * @param completion_condition The function object to be called to determine
366 * whether the write operation is complete. The signature of the function object
368 * @code std::size_t completion_condition(
369 * // Result of latest write_some_at operation.
370 * const boost::system::error_code& error,
372 * // Number of bytes transferred so far.
373 * std::size_t bytes_transferred
375 * A return value of 0 indicates that the write operation is complete. A
376 * non-zero return value indicates the maximum number of bytes to be written on
377 * the next call to the device's write_some_at function.
379 * @param ec Set to indicate what error occurred, if any.
381 * @returns The number of bytes written. If an error occurs, returns the total
382 * number of bytes successfully transferred prior to the error.
384 template <typename SyncRandomAccessWriteDevice, typename Allocator,
385 typename CompletionCondition>
386 std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
387 basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
388 boost::system::error_code& ec);
390 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
391 #endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
395 * @defgroup async_write_at boost::asio::async_write_at
397 * @brief The @c async_write_at function is a composed asynchronous operation
398 * that writes a certain amount of data at the specified offset before
403 /// Start an asynchronous operation to write all of the supplied data at the
404 /// specified offset.
406 * This function is used to asynchronously write a certain number of bytes of
407 * data to a random access device at a specified offset. The function call
408 * always returns immediately. The asynchronous operation will continue until
409 * one of the following conditions is true:
411 * @li All of the data in the supplied buffers has been written. That is, the
412 * bytes transferred is equal to the sum of the buffer sizes.
414 * @li An error occurred.
416 * This operation is implemented in terms of zero or more calls to the device's
417 * async_write_some_at function, and is known as a <em>composed operation</em>.
418 * The program must ensure that the device performs no <em>overlapping</em>
419 * write operations (such as async_write_at, the device's async_write_some_at
420 * function, or any other composed operations that perform writes) until this
421 * operation completes. Operations are overlapping if the regions defined by
422 * their offsets, and the numbers of bytes to write, intersect.
424 * @param d The device to which the data is to be written. The type must support
425 * the AsyncRandomAccessWriteDevice concept.
427 * @param offset The offset at which the data will be written.
429 * @param buffers One or more buffers containing the data to be written.
430 * Although the buffers object may be copied as necessary, ownership of the
431 * underlying memory blocks is retained by the caller, which must guarantee
432 * that they remain valid until the handler is called.
434 * @param handler The handler to be called when the write operation completes.
435 * Copies will be made of the handler as required. The function signature of
436 * the handler must be:
437 * @code void handler(
438 * // Result of operation.
439 * const boost::system::error_code& error,
441 * // Number of bytes written from the buffers. If an error
442 * // occurred, this will be less than the sum of the buffer sizes.
443 * std::size_t bytes_transferred
445 * Regardless of whether the asynchronous operation completes immediately or
446 * not, the handler will not be invoked from within this function. On
447 * immediate completion, invocation of the handler will be performed in a
448 * manner equivalent to using boost::asio::post().
451 * To write a single data buffer use the @ref buffer function as follows:
453 * boost::asio::async_write_at(d, 42, boost::asio::buffer(data, size), handler);
455 * See the @ref buffer documentation for information on writing multiple
456 * buffers in one go, and how to use it with arrays, boost::array or
459 template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
460 BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
461 std::size_t)) WriteHandler
462 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
463 typename AsyncRandomAccessWriteDevice::executor_type)>
464 BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
465 void (boost::system::error_code, std::size_t))
466 async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
467 const ConstBufferSequence& buffers,
468 BOOST_ASIO_MOVE_ARG(WriteHandler) handler
469 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
470 typename AsyncRandomAccessWriteDevice::executor_type));
472 /// Start an asynchronous operation to write a certain amount of data at the
473 /// specified offset.
475 * This function is used to asynchronously write a certain number of bytes of
476 * data to a random access device at a specified offset. The function call
477 * always returns immediately. The asynchronous operation will continue until
478 * one of the following conditions is true:
480 * @li All of the data in the supplied buffers has been written. That is, the
481 * bytes transferred is equal to the sum of the buffer sizes.
483 * @li The completion_condition function object returns 0.
485 * This operation is implemented in terms of zero or more calls to the device's
486 * async_write_some_at function, and is known as a <em>composed operation</em>.
487 * The program must ensure that the device performs no <em>overlapping</em>
488 * write operations (such as async_write_at, the device's async_write_some_at
489 * function, or any other composed operations that perform writes) until this
490 * operation completes. Operations are overlapping if the regions defined by
491 * their offsets, and the numbers of bytes to write, intersect.
493 * @param d The device to which the data is to be written. The type must support
494 * the AsyncRandomAccessWriteDevice concept.
496 * @param offset The offset at which the data will be written.
498 * @param buffers One or more buffers containing the data to be written.
499 * Although the buffers object may be copied as necessary, ownership of the
500 * underlying memory blocks is retained by the caller, which must guarantee
501 * that they remain valid until the handler is called.
503 * @param completion_condition The function object to be called to determine
504 * whether the write operation is complete. The signature of the function object
506 * @code std::size_t completion_condition(
507 * // Result of latest async_write_some_at operation.
508 * const boost::system::error_code& error,
510 * // Number of bytes transferred so far.
511 * std::size_t bytes_transferred
513 * A return value of 0 indicates that the write operation is complete. A
514 * non-zero return value indicates the maximum number of bytes to be written on
515 * the next call to the device's async_write_some_at function.
517 * @param handler The handler to be called when the write operation completes.
518 * Copies will be made of the handler as required. The function signature of the
520 * @code void handler(
521 * // Result of operation.
522 * const boost::system::error_code& error,
524 * // Number of bytes written from the buffers. If an error
525 * // occurred, this will be less than the sum of the buffer sizes.
526 * std::size_t bytes_transferred
528 * Regardless of whether the asynchronous operation completes immediately or
529 * not, the handler will not be invoked from within this function. On
530 * immediate completion, invocation of the handler will be performed in a
531 * manner equivalent to using boost::asio::post().
534 * To write a single data buffer use the @ref buffer function as follows:
535 * @code boost::asio::async_write_at(d, 42,
536 * boost::asio::buffer(data, size),
537 * boost::asio::transfer_at_least(32),
539 * See the @ref buffer documentation for information on writing multiple
540 * buffers in one go, and how to use it with arrays, boost::array or
543 template <typename AsyncRandomAccessWriteDevice,
544 typename ConstBufferSequence, typename CompletionCondition,
545 BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
546 std::size_t)) WriteHandler
547 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
548 typename AsyncRandomAccessWriteDevice::executor_type)>
549 BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
550 void (boost::system::error_code, std::size_t))
551 async_write_at(AsyncRandomAccessWriteDevice& d,
552 uint64_t offset, const ConstBufferSequence& buffers,
553 CompletionCondition completion_condition,
554 BOOST_ASIO_MOVE_ARG(WriteHandler) handler
555 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
556 typename AsyncRandomAccessWriteDevice::executor_type));
558 #if !defined(BOOST_ASIO_NO_EXTENSIONS)
559 #if !defined(BOOST_ASIO_NO_IOSTREAM)
561 /// Start an asynchronous operation to write all of the supplied data at the
562 /// specified offset.
564 * This function is used to asynchronously write a certain number of bytes of
565 * data to a random access device at a specified offset. The function call
566 * always returns immediately. The asynchronous operation will continue until
567 * one of the following conditions is true:
569 * @li All of the data in the supplied basic_streambuf has been written.
571 * @li An error occurred.
573 * This operation is implemented in terms of zero or more calls to the device's
574 * async_write_some_at function, and is known as a <em>composed operation</em>.
575 * The program must ensure that the device performs no <em>overlapping</em>
576 * write operations (such as async_write_at, the device's async_write_some_at
577 * function, or any other composed operations that perform writes) until this
578 * operation completes. Operations are overlapping if the regions defined by
579 * their offsets, and the numbers of bytes to write, intersect.
581 * @param d The device to which the data is to be written. The type must support
582 * the AsyncRandomAccessWriteDevice concept.
584 * @param offset The offset at which the data will be written.
586 * @param b A basic_streambuf object from which data will be written. Ownership
587 * of the streambuf is retained by the caller, which must guarantee that it
588 * remains valid until the handler is called.
590 * @param handler The handler to be called when the write operation completes.
591 * Copies will be made of the handler as required. The function signature of the
593 * @code void handler(
594 * // Result of operation.
595 * const boost::system::error_code& error,
597 * // Number of bytes written from the buffers. If an error
598 * // occurred, this will be less than the sum of the buffer sizes.
599 * std::size_t bytes_transferred
601 * Regardless of whether the asynchronous operation completes immediately or
602 * not, the handler will not be invoked from within this function. On
603 * immediate completion, invocation of the handler will be performed in a
604 * manner equivalent to using boost::asio::post().
606 template <typename AsyncRandomAccessWriteDevice, typename Allocator,
607 BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
608 std::size_t)) WriteHandler
609 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
610 typename AsyncRandomAccessWriteDevice::executor_type)>
611 BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
612 void (boost::system::error_code, std::size_t))
613 async_write_at(AsyncRandomAccessWriteDevice& d,
614 uint64_t offset, basic_streambuf<Allocator>& b,
615 BOOST_ASIO_MOVE_ARG(WriteHandler) handler
616 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
617 typename AsyncRandomAccessWriteDevice::executor_type));
619 /// Start an asynchronous operation to write a certain amount of data at the
620 /// specified offset.
622 * This function is used to asynchronously write a certain number of bytes of
623 * data to a random access device at a specified offset. The function call
624 * always returns immediately. The asynchronous operation will continue until
625 * one of the following conditions is true:
627 * @li All of the data in the supplied basic_streambuf has been written.
629 * @li The completion_condition function object returns 0.
631 * This operation is implemented in terms of zero or more calls to the device's
632 * async_write_some_at function, and is known as a <em>composed operation</em>.
633 * The program must ensure that the device performs no <em>overlapping</em>
634 * write operations (such as async_write_at, the device's async_write_some_at
635 * function, or any other composed operations that perform writes) until this
636 * operation completes. Operations are overlapping if the regions defined by
637 * their offsets, and the numbers of bytes to write, intersect.
639 * @param d The device to which the data is to be written. The type must support
640 * the AsyncRandomAccessWriteDevice concept.
642 * @param offset The offset at which the data will be written.
644 * @param b A basic_streambuf object from which data will be written. Ownership
645 * of the streambuf is retained by the caller, which must guarantee that it
646 * remains valid until the handler is called.
648 * @param completion_condition The function object to be called to determine
649 * whether the write operation is complete. The signature of the function object
651 * @code std::size_t completion_condition(
652 * // Result of latest async_write_some_at operation.
653 * const boost::system::error_code& error,
655 * // Number of bytes transferred so far.
656 * std::size_t bytes_transferred
658 * A return value of 0 indicates that the write operation is complete. A
659 * non-zero return value indicates the maximum number of bytes to be written on
660 * the next call to the device's async_write_some_at function.
662 * @param handler The handler to be called when the write operation completes.
663 * Copies will be made of the handler as required. The function signature of the
665 * @code void handler(
666 * // Result of operation.
667 * const boost::system::error_code& error,
669 * // Number of bytes written from the buffers. If an error
670 * // occurred, this will be less than the sum of the buffer sizes.
671 * std::size_t bytes_transferred
673 * Regardless of whether the asynchronous operation completes immediately or
674 * not, the handler will not be invoked from within this function. On
675 * immediate completion, invocation of the handler will be performed in a
676 * manner equivalent to using boost::asio::post().
678 template <typename AsyncRandomAccessWriteDevice,
679 typename Allocator, typename CompletionCondition,
680 BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
681 std::size_t)) WriteHandler
682 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
683 typename AsyncRandomAccessWriteDevice::executor_type)>
684 BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
685 void (boost::system::error_code, std::size_t))
686 async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
687 basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
688 BOOST_ASIO_MOVE_ARG(WriteHandler) handler
689 BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
690 typename AsyncRandomAccessWriteDevice::executor_type));
692 #endif // !defined(BOOST_ASIO_NO_IOSTREAM)
693 #endif // !defined(BOOST_ASIO_NO_EXTENSIONS)
700 #include <boost/asio/detail/pop_options.hpp>
702 #include <boost/asio/impl/write_at.hpp>
704 #endif // BOOST_ASIO_WRITE_AT_HPP