本文整理汇总了C++中file_status类的典型用法代码示例。如果您正苦于以下问题:C++ file_status类的具体用法?C++ file_status怎么用?C++ file_status使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了file_status类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
using namespace fs;
// Default ctor
{
static_assert(std::is_nothrow_default_constructible<file_status>::value,
"The default constructor must be noexcept");
static_assert(test_convertible<file_status>(),
"The default constructor must not be explicit");
const file_status f;
assert(f.type() == file_type::none);
assert(f.permissions() == perms::unknown);
}
// Unary ctor
{
static_assert(std::is_nothrow_constructible<file_status, file_type>::value,
"This constructor must be noexcept");
static_assert(!test_convertible<file_status, file_type>(),
"This constructor must be explicit");
const file_status f(file_type::not_found);
assert(f.type() == file_type::not_found);
assert(f.permissions() == perms::unknown);
}
// Binary ctor
{
static_assert(std::is_nothrow_constructible<file_status, file_type, perms>::value,
"This constructor must be noexcept");
static_assert(!test_convertible<file_status, file_type, perms>(),
"This constructor must b explicit");
const file_status f(file_type::regular, perms::owner_read);
assert(f.type() == file_type::regular);
assert(f.permissions() == perms::owner_read);
}
}
示例2: status_known
inline bool status_known( file_status f ) { return f.type() != status_unknown; }
示例3: is_regular_file
inline bool is_regular_file(file_status s) noexcept
{
return s.type() == file_type::regular;
}
示例4: exists
inline bool exists(file_status s) noexcept
{ return status_known(s) && s.type() != file_type::not_found; }
示例5: status_known
inline bool status_known(file_status f) { return f.type() != status_error; }
示例6: is_symlink
inline bool is_symlink(file_status f) { return f.type() == symlink_file; }
示例7: exists
inline bool exists(file_status f) { return f.type() != status_error
&& f.type() != file_not_found; }
示例8: permissions_present
inline bool permissions_present(file_status f)
{return f.permissions() != perms_not_known;}
示例9: status_known
inline bool status_known(file_status s) noexcept
{ return s.type() != file_type::none; }
示例10: is_symlink
inline bool is_symlink(file_status s) noexcept
{ return s.type() == file_type::symlink; }
示例11: is_socket
inline bool is_socket(file_status s) noexcept
{ return s.type() == file_type::socket; }
示例12: is_fifo
inline bool is_fifo(file_status s) noexcept
{ return s.type() == file_type::fifo; }
示例13: is_character_file
inline bool is_character_file(file_status s) noexcept
{ return s.type() == file_type::character; }
示例14: is_block_file
inline bool is_block_file(file_status s) noexcept
{ return s.type() == file_type::block; }
示例15: exists
inline bool exists( file_status f ) { return f.type() != status_unknown && f.type() != file_not_found; }