SyncReadStream.qbk 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [/
  2. / Copyright (c) 2003-2019 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. [section:SyncReadStream Buffer-oriented synchronous read stream requirements]
  8. A type `X` meets the `SyncReadStream` requirements if it satisfies the
  9. requirements listed below.
  10. In the table below, `a` denotes a value of type `X`, `mb` denotes a (possibly
  11. const) value satisfying the [link boost_asio.reference.MutableBufferSequence
  12. `MutableBufferSequence`] requirements, and `ec` denotes an object of type
  13. `error_code`.
  14. [table SyncReadStream requirements
  15. [[operation] [type] [semantics, pre/post-conditions]]
  16. [
  17. [`a.read_some(mb)`\n
  18. `a.read_some(mb,ec)`]
  19. [`size_t`]
  20. [
  21. Meets the requirements for a [link boost_asio.reference.read_write_operations
  22. read operation].\n
  23. \n
  24. If `buffer_size(mb) > 0`, reads one or more bytes of data from the stream
  25. `a` into the buffer sequence `mb`. If successful, sets `ec` such that
  26. `!ec` is `true`, and returns the number of bytes read. If an error
  27. occurred, sets `ec` such that `!!ec` is `true`, and returns 0. If all
  28. data has been read from the stream, and the stream performed an orderly
  29. shutdown, sets `ec` to `stream_errc::eof` and returns 0.\n
  30. \n
  31. If `buffer_size(mb) == 0`, the operation shall not block. Sets `ec` such
  32. that `!ec` is `true`, and returns 0.
  33. ]
  34. ]
  35. ]
  36. [endsect]