diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/read_at.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/read_at.hpp | 92 |
1 files changed, 87 insertions, 5 deletions
diff --git a/3rdParty/Boost/src/boost/asio/read_at.hpp b/3rdParty/Boost/src/boost/asio/read_at.hpp index 1feba6c..7eb30e0 100644 --- a/3rdParty/Boost/src/boost/asio/read_at.hpp +++ b/3rdParty/Boost/src/boost/asio/read_at.hpp @@ -2,7 +2,7 @@ // read_at.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -88,6 +88,52 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, * @li The supplied buffers are full. That is, the bytes transferred is equal to * the sum of the buffer sizes. * + * @li An error occurred. + * + * This operation is implemented in terms of zero or more calls to the device's + * read_some_at function. + * + * @param d The device from which the data is to be read. The type must support + * the SyncRandomAccessReadDevice concept. + * + * @param offset The offset at which the data will be read. + * + * @param buffers One or more buffers into which the data will be read. The sum + * of the buffer sizes indicates the maximum number of bytes to read from the + * device. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes transferred. + * + * @par Example + * To read into a single data buffer use the @ref buffer function as follows: + * @code boost::asio::read_at(d, 42, + * boost::asio::buffer(data, size), ec); @endcode + * See the @ref buffer documentation for information on reading into multiple + * buffers in one go, and how to use it with arrays, boost::array or + * std::vector. + * + * @note This overload is equivalent to calling: + * @code boost::asio::read_at( + * d, 42, buffers, + * boost::asio::transfer_all(), ec); @endcode + */ +template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence> +std::size_t read_at(SyncRandomAccessReadDevice& d, + boost::uint64_t offset, const MutableBufferSequence& buffers, + boost::system::error_code& ec); + +/// Attempt to read a certain amount of data at the specified offset before +/// returning. +/** + * This function is used to read a certain number of bytes of data from a + * random access device at the specified offset. The call will block until one + * of the following conditions is true: + * + * @li The supplied buffers are full. That is, the bytes transferred is equal to + * the sum of the buffer sizes. + * * @li The completion_condition function object returns 0. * * This operation is implemented in terms of zero or more calls to the device's @@ -224,6 +270,39 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, * random access device at the specified offset. The call will block until one * of the following conditions is true: * + * @li An error occurred. + * + * This operation is implemented in terms of zero or more calls to the device's + * read_some_at function. + * + * @param d The device from which the data is to be read. The type must support + * the SyncRandomAccessReadDevice concept. + * + * @param offset The offset at which the data will be read. + * + * @param b The basic_streambuf object into which the data will be read. + * + * @param ec Set to indicate what error occurred, if any. + * + * @returns The number of bytes transferred. + * + * @note This overload is equivalent to calling: + * @code boost::asio::read_at( + * d, 42, b, + * boost::asio::transfer_all(), ec); @endcode + */ +template <typename SyncRandomAccessReadDevice, typename Allocator> +std::size_t read_at(SyncRandomAccessReadDevice& d, + boost::uint64_t offset, basic_streambuf<Allocator>& b, + boost::system::error_code& ec); + +/// Attempt to read a certain amount of data at the specified offset before +/// returning. +/** + * This function is used to read a certain number of bytes of data from a + * random access device at the specified offset. The call will block until one + * of the following conditions is true: + * * @li The completion_condition function object returns 0. * * This operation is implemented in terms of zero or more calls to the device's @@ -377,7 +456,8 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence, typename ReadHandler> void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, - const MutableBufferSequence& buffers, ReadHandler handler); + const MutableBufferSequence& buffers, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); /// Start an asynchronous operation to read a certain amount of data at the /// specified offset. @@ -448,7 +528,8 @@ template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence, typename CompletionCondition, typename ReadHandler> void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, ReadHandler handler); + CompletionCondition completion_condition, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); #if !defined(BOOST_NO_IOSTREAM) @@ -500,7 +581,7 @@ void async_read_at(AsyncRandomAccessReadDevice& d, template <typename AsyncRandomAccessReadDevice, typename Allocator, typename ReadHandler> void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, - basic_streambuf<Allocator>& b, ReadHandler handler); + basic_streambuf<Allocator>& b, BOOST_ASIO_MOVE_ARG(ReadHandler) handler); /// Start an asynchronous operation to read a certain amount of data at the /// specified offset. @@ -559,7 +640,8 @@ template <typename AsyncRandomAccessReadDevice, typename Allocator, typename CompletionCondition, typename ReadHandler> void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, - CompletionCondition completion_condition, ReadHandler handler); + CompletionCondition completion_condition, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); #endif // !defined(BOOST_NO_IOSTREAM) |