faio
faio 公共 C++ 接口参考
载入中...
搜索中...
未找到
faio::fs::seek_from类 参考

文件定位的起点和偏移量。 更多...

Public 类型

enum class  origin { start , current , end }
 定位基准。 更多...

静态 Public 成员函数

static seek_from start (std::uint64_t offset)
 从文件开头计算绝对定位。
static seek_from current (std::int64_t offset) noexcept
 从当前文件游标计算相对定位。
static seek_from end (std::int64_t offset) noexcept
 从文件末尾计算相对定位。

Public 属性

origin base
 定位起点。
std::int64_t offset
 相对基准的有符号字节位移。

详细描述

文件定位的起点和偏移量。

公共头文件
#include <faio/fs/file.hpp>

成员枚举类型说明

◆ origin

enum class faio::fs::seek_from::origin
strong

定位基准。

枚举值
start 

从文件开头计算。

current 

从当前逻辑游标计算。

end 

从文件末尾计算。

成员函数说明

◆ start()

seek_from faio::fs::seek_from::start ( std::uint64_t offset)
static

从文件开头计算绝对定位。

参数
offset相对所选起点的字节位移;current/end 支持负值,start 要求非负且不超 int64_t。
返回
返回 seek_from;超过 int64_t 范围时抛 out_of_range。

◆ current()

seek_from faio::fs::seek_from::current ( std::int64_t offset)
staticnoexcept

从当前文件游标计算相对定位。

参数
offset相对所选起点的字节位移;current/end 支持负值,start 要求非负且不超 int64_t。
返回
返回 seek_from,允许负位移。

◆ end()

seek_from faio::fs::seek_from::end ( std::int64_t offset)
staticnoexcept

从文件末尾计算相对定位。

参数
offset相对所选起点的字节位移;current/end 支持负值,start 要求非负且不超 int64_t。
返回
返回 seek_from,允许负位移。