2
0
mirror of https://github.com/boostorg/cobalt.git synced 2026-01-28 07:02:14 +00:00
Files
cobalt/doc/reference/io/stream_file.adoc
Klemens Morgenstern a3c061f29c Minor doc typo fixes
2026-01-02 09:19:54 +08:00

30 lines
984 B
Plaintext

== cobalt/io/stream_file.hpp
The `stream_file` provides stream access to file.
If Asio does not support asynchronous file IO, Cobalt will fall back on synchronous operations.
[source,cpp]
----
struct stream_file : file, stream
{
stream_file(const executor & executor = this_thread::get_executor());
stream_file(const char * path, file::flags open_flags,
const executor & executor = this_thread::get_executor());
stream_file(const std::string & path, file::flags open_flags,
const executor & executor = this_thread::get_executor());
stream_file(const native_handle_type & native_file,
const executor & executor = this_thread::get_executor());
stream_file(stream_file && sf) noexcept;
write_op write_some(const_buffer_sequence buffer);
read_op read_some(mutable_buffer_sequence buffer);
// advance the position in the file
system::result<std::uint64_t> seek(
std::int64_t offset,
seek_basis whence);
};
----