File indexing completed on 2026-05-03 08:13:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___FILESYSTEM_FILE_STATUS_H
0011 #define _LIBCPP___FILESYSTEM_FILE_STATUS_H
0012
0013 #include <__config>
0014 #include <__filesystem/file_type.h>
0015 #include <__filesystem/perms.h>
0016
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 # pragma GCC system_header
0019 #endif
0020
0021 #if _LIBCPP_STD_VER >= 17
0022
0023 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
0024
0025 class _LIBCPP_EXPORTED_FROM_ABI file_status {
0026 public:
0027
0028 _LIBCPP_HIDE_FROM_ABI file_status() noexcept : file_status(file_type::none) {}
0029 _LIBCPP_HIDE_FROM_ABI explicit file_status(file_type __ft, perms __prms = perms::unknown) noexcept
0030 : __ft_(__ft), __prms_(__prms) {}
0031
0032 _LIBCPP_HIDE_FROM_ABI file_status(const file_status&) noexcept = default;
0033 _LIBCPP_HIDE_FROM_ABI file_status(file_status&&) noexcept = default;
0034
0035 _LIBCPP_HIDE_FROM_ABI ~file_status() {}
0036
0037 _LIBCPP_HIDE_FROM_ABI file_status& operator=(const file_status&) noexcept = default;
0038 _LIBCPP_HIDE_FROM_ABI file_status& operator=(file_status&&) noexcept = default;
0039
0040
0041 _LIBCPP_HIDE_FROM_ABI file_type type() const noexcept { return __ft_; }
0042
0043 _LIBCPP_HIDE_FROM_ABI perms permissions() const noexcept { return __prms_; }
0044
0045
0046 _LIBCPP_HIDE_FROM_ABI void type(file_type __ft) noexcept { __ft_ = __ft; }
0047
0048 _LIBCPP_HIDE_FROM_ABI void permissions(perms __p) noexcept { __prms_ = __p; }
0049
0050 # if _LIBCPP_STD_VER >= 20
0051
0052 _LIBCPP_HIDE_FROM_ABI friend bool operator==(const file_status& __lhs, const file_status& __rhs) noexcept {
0053 return __lhs.type() == __rhs.type() && __lhs.permissions() == __rhs.permissions();
0054 }
0055
0056 # endif
0057
0058 private:
0059 file_type __ft_;
0060 perms __prms_;
0061 };
0062
0063 _LIBCPP_END_NAMESPACE_FILESYSTEM
0064
0065 #endif
0066
0067 #endif