首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::filesystem::is_empty

Defined in header <filesystem>

?

?

bool is_empty( const std::filesystem::path& p ); bool is_empty( const std::filesystem::path& p, std::error_code& ec );

?

(since C++17)

检查给定路径是否引用空文件或目录。

参数

p

-

path to examine

ec

-

error code to modify in case of error

返回值

true如果由p或者如果所指示的类型s引用空文件或目录,false否则。非抛出重载返回。false如果发生错误。

例外

不占用std::error_code&参数抛文件系统[医]误差关于基础OS API错误,使用p作为第一个参数和操作系统错误代码作为错误代码参数。std::bad_alloc如果内存分配失败,则可能引发。过载std::error_code&参数,如果OSAPI调用失败,则将其设置为OSAPI错误代码,并执行ec.clear()如果没有错误发生。这个过载

noexcept规格:

noexcept

另见

statussymlink_status (C++17)(C++17)

determines file attributesdetermines file attributes, checking the symlink target (function)

exists (C++17)

checks whether path refers to existing file system object (function)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com