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

文件系统访问权限的值类型。 更多...

Public 成员函数

 Permissions (std::filesystem::perms bits=std::filesystem::perms::unknown) noexcept
 构造Permissions对象。
std::filesystem::perms bits () const noexcept
 取得保存的文件权限位。
bool readonly () const noexcept
 检查所有写权限位是否均未设置。
void set_readonly (bool value) noexcept
 修改权限值中的写权限位。

详细描述

文件系统访问权限的值类型。

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

构造及析构函数说明

◆ Permissions()

faio::fs::Permissions::Permissions ( std::filesystem::perms bits = std::filesystem::perms::unknown)
explicitnoexcept

构造Permissions对象。

参数
bits保存的文件权限位;默认 unknown。 默认值:std::filesystem::perms::unknown。
返回值
构造函数不返回值。
注解
对象的复制、移动和资源所有权遵循类型说明。

成员函数说明

◆ bits()

std::filesystem::perms faio::fs::Permissions::bits ( ) const
noexcept

取得保存的文件权限位。

返回
返回 std::filesystem::perms。

◆ readonly()

bool faio::fs::Permissions::readonly ( ) const
noexcept

检查所有写权限位是否均未设置。

返回
没有 owner/group/others 写权限时返回 true。

◆ set_readonly()

void faio::fs::Permissions::set_readonly ( bool value)
noexcept

修改权限值中的写权限位。

参数
value要设置、编码或移动发送的值;具体类型见当前重载签名。
返回值
无返回值;true 清除全部写位,false 添加 owner_write。
注解
仅修改值对象;写回文件需调用 set_permissions。