diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/read.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/read.hpp | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/3rdParty/Boost/src/boost/asio/read.hpp b/3rdParty/Boost/src/boost/asio/read.hpp index fd13e75..88d2dc2 100644 --- a/3rdParty/Boost/src/boost/asio/read.hpp +++ b/3rdParty/Boost/src/boost/asio/read.hpp @@ -80,6 +80,46 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers); * @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 stream's + * read_some function. + * + * @param s The stream from which the data is to be read. The type must support + * the SyncReadStream concept. + * + * @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 + * stream. + * + * @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(s, 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( + * s, buffers, + * boost::asio::transfer_all(), ec); @endcode + */ +template <typename SyncReadStream, typename MutableBufferSequence> +std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, + boost::system::error_code& ec); + +/// Attempt to read a certain amount of data from a stream before returning. +/** + * This function is used to read a certain number of bytes of data from a + * stream. 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 stream's @@ -201,6 +241,34 @@ std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b); * This function is used to read a certain number of bytes of data from a * stream. 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 stream's + * read_some function. + * + * @param s The stream from which the data is to be read. The type must support + * the SyncReadStream concept. + * + * @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( + * s, b, + * boost::asio::transfer_all(), ec); @endcode + */ +template <typename SyncReadStream, typename Allocator> +std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b, + boost::system::error_code& ec); + +/// Attempt to read a certain amount of data from a stream before returning. +/** + * This function is used to read a certain number of bytes of data from a + * stream. 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 stream's @@ -347,7 +415,7 @@ std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b, template <typename AsyncReadStream, typename MutableBufferSequence, typename ReadHandler> void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, - ReadHandler handler); + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); /// Start an asynchronous operation to read a certain amount of data from a /// stream. @@ -415,7 +483,8 @@ void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, template <typename AsyncReadStream, typename MutableBufferSequence, typename CompletionCondition, typename ReadHandler> void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, - CompletionCondition completion_condition, ReadHandler handler); + CompletionCondition completion_condition, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); #if !defined(BOOST_NO_IOSTREAM) @@ -467,7 +536,7 @@ void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, */ template <typename AsyncReadStream, typename Allocator, typename ReadHandler> void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b, - ReadHandler handler); + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); /// Start an asynchronous operation to read a certain amount of data from a /// stream. @@ -526,7 +595,8 @@ void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b, template <typename AsyncReadStream, typename Allocator, typename CompletionCondition, typename ReadHandler> void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b, - CompletionCondition completion_condition, ReadHandler handler); + CompletionCondition completion_condition, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler); #endif // !defined(BOOST_NO_IOSTREAM) |