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_DIRECTORY_OPTIONS_H
11 #define _LIBCPP___FILESYSTEM_DIRECTORY_OPTIONS_H
15 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16 # pragma GCC system_header
19 #if _LIBCPP_STD_VER >= 17
21 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
23 enum class directory_options
: unsigned char { none
= 0, follow_directory_symlink
= 1, skip_permission_denied
= 2 };
25 _LIBCPP_HIDE_FROM_ABI
inline constexpr directory_options
operator&(directory_options __lhs
, directory_options __rhs
) {
26 return static_cast<directory_options
>(static_cast<unsigned char>(__lhs
) & static_cast<unsigned char>(__rhs
));
29 _LIBCPP_HIDE_FROM_ABI
inline constexpr directory_options
operator|(directory_options __lhs
, directory_options __rhs
) {
30 return static_cast<directory_options
>(static_cast<unsigned char>(__lhs
) | static_cast<unsigned char>(__rhs
));
33 _LIBCPP_HIDE_FROM_ABI
inline constexpr directory_options
operator^(directory_options __lhs
, directory_options __rhs
) {
34 return static_cast<directory_options
>(static_cast<unsigned char>(__lhs
) ^ static_cast<unsigned char>(__rhs
));
37 _LIBCPP_HIDE_FROM_ABI
inline constexpr directory_options
operator~(directory_options __lhs
) {
38 return static_cast<directory_options
>(~static_cast<unsigned char>(__lhs
));
41 _LIBCPP_HIDE_FROM_ABI
inline directory_options
& operator&=(directory_options
& __lhs
, directory_options __rhs
) {
42 return __lhs
= __lhs
& __rhs
;
45 _LIBCPP_HIDE_FROM_ABI
inline directory_options
& operator|=(directory_options
& __lhs
, directory_options __rhs
) {
46 return __lhs
= __lhs
| __rhs
;
49 _LIBCPP_HIDE_FROM_ABI
inline directory_options
& operator^=(directory_options
& __lhs
, directory_options __rhs
) {
50 return __lhs
= __lhs
^ __rhs
;
53 _LIBCPP_END_NAMESPACE_FILESYSTEM
55 #endif // _LIBCPP_STD_VER >= 17
57 #endif // _LIBCPP___FILESYSTEM_DIRECTORY_OPTIONS_H