2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
11 #define _LIBCPP___FILESYSTEM_PERM_OPTIONS_H
13 #include <__availability>
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 # pragma GCC system_header
20 #ifndef _LIBCPP_CXX03_LANG
22 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
24 enum class perm_options
: unsigned char {
31 _LIBCPP_INLINE_VISIBILITY
32 inline constexpr perm_options
operator&(perm_options __lhs
, perm_options __rhs
) {
33 return static_cast<perm_options
>(static_cast<unsigned>(__lhs
) &
34 static_cast<unsigned>(__rhs
));
37 _LIBCPP_INLINE_VISIBILITY
38 inline constexpr perm_options
operator|(perm_options __lhs
, perm_options __rhs
) {
39 return static_cast<perm_options
>(static_cast<unsigned>(__lhs
) |
40 static_cast<unsigned>(__rhs
));
43 _LIBCPP_INLINE_VISIBILITY
44 inline constexpr perm_options
operator^(perm_options __lhs
, perm_options __rhs
) {
45 return static_cast<perm_options
>(static_cast<unsigned>(__lhs
) ^
46 static_cast<unsigned>(__rhs
));
49 _LIBCPP_INLINE_VISIBILITY
50 inline constexpr perm_options
operator~(perm_options __lhs
) {
51 return static_cast<perm_options
>(~static_cast<unsigned>(__lhs
));
54 _LIBCPP_INLINE_VISIBILITY
55 inline perm_options
& operator&=(perm_options
& __lhs
, perm_options __rhs
) {
56 return __lhs
= __lhs
& __rhs
;
59 _LIBCPP_INLINE_VISIBILITY
60 inline perm_options
& operator|=(perm_options
& __lhs
, perm_options __rhs
) {
61 return __lhs
= __lhs
| __rhs
;
64 _LIBCPP_INLINE_VISIBILITY
65 inline perm_options
& operator^=(perm_options
& __lhs
, perm_options __rhs
) {
66 return __lhs
= __lhs
^ __rhs
;
69 _LIBCPP_END_NAMESPACE_FILESYSTEM
71 #endif // _LIBCPP_CXX03_LANG
73 #endif // _LIBCPP___FILESYSTEM_PERM_OPTIONS_H