1#ifndef NEFORCE_CORE_FILE_FILE_ASYNC_HPP__
2#define NEFORCE_CORE_FILE_FILE_ASYNC_HPP__
17NEFORCE_BEGIN_NAMESPACE__
36#ifdef NEFORCE_PLATFORM_WINDOWS
48#ifdef NEFORCE_USING_IO_URING
98 do_async_read(ctx, buffer,
size, -1,
nullptr,
move(handler));
111 do_async_read(ctx, buffer,
size, offset,
nullptr,
move(handler));
124 do_async_read(ctx, buffer,
size, -1, &slot,
move(handler));
175NEFORCE_END_NAMESPACE__
::LONGLONG difference_type
偏移量类型
_NEFORCE native_handle_type native_handle_type
原生文件句柄类型
void async_write(io_context &ctx, string data, size_type size, cancellation_slot &slot, function< void(error_code, size_type)> handler)
带取消槽异步写入数据
void async_read(io_context &ctx, string &buffer, size_type size, function< void(error_code, size_type)> handler)
异步读取数据
file_async & operator=(file_async &&other) noexcept
移动赋值运算符
file_async(native_handle_type handle)
构造函数
void async_read(io_context &ctx, string &buffer, size_type size, cancellation_slot &slot, function< void(error_code, size_type)> handler)
带取消槽异步读取数据
void async_write(io_context &ctx, string data, size_type size, function< void(error_code, size_type)> handler)
异步写入数据
native_handle_type native_handle() const noexcept
获取原生文件句柄
file_async(file_async &&other) noexcept
移动构造函数
void async_write(io_context &ctx, string data, size_type size, difference_type offset, function< void(error_code, size_type)> handler)
指定偏移量异步写入数据
void async_read(io_context &ctx, string &buffer, size_type size, difference_type offset, function< void(error_code, size_type)> handler)
指定偏移量异步读取数据
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result) noexcept(noexcept(inner::__move_aux(first, last, result)))
移动范围元素
constexpr decltype(auto) size(const Container &cont) noexcept(noexcept(cont.size()))
获取容器的大小
constexpr decltype(auto) data(Container &cont) noexcept(noexcept(cont.data()))
获取容器的底层数据指针