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_COPY_OPTIONS_H
11 #define _LIBCPP___FILESYSTEM_COPY_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 copy_options
: unsigned short {
27 overwrite_existing
= 2,
32 directories_only
= 64,
33 create_symlinks
= 128,
34 create_hard_links
= 256,
35 __in_recursive_copy
= 512,
38 _LIBCPP_INLINE_VISIBILITY
39 inline constexpr copy_options
operator&(copy_options __lhs
, copy_options __rhs
) {
40 return static_cast<copy_options
>(static_cast<unsigned short>(__lhs
) &
41 static_cast<unsigned short>(__rhs
));
44 _LIBCPP_INLINE_VISIBILITY
45 inline constexpr copy_options
operator|(copy_options __lhs
, copy_options __rhs
) {
46 return static_cast<copy_options
>(static_cast<unsigned short>(__lhs
) |
47 static_cast<unsigned short>(__rhs
));
50 _LIBCPP_INLINE_VISIBILITY
51 inline constexpr copy_options
operator^(copy_options __lhs
, copy_options __rhs
) {
52 return static_cast<copy_options
>(static_cast<unsigned short>(__lhs
) ^
53 static_cast<unsigned short>(__rhs
));
56 _LIBCPP_INLINE_VISIBILITY
57 inline constexpr copy_options
operator~(copy_options __lhs
) {
58 return static_cast<copy_options
>(~static_cast<unsigned short>(__lhs
));
61 _LIBCPP_INLINE_VISIBILITY
62 inline copy_options
& operator&=(copy_options
& __lhs
, copy_options __rhs
) {
63 return __lhs
= __lhs
& __rhs
;
66 _LIBCPP_INLINE_VISIBILITY
67 inline copy_options
& operator|=(copy_options
& __lhs
, copy_options __rhs
) {
68 return __lhs
= __lhs
| __rhs
;
71 _LIBCPP_INLINE_VISIBILITY
72 inline copy_options
& operator^=(copy_options
& __lhs
, copy_options __rhs
) {
73 return __lhs
= __lhs
^ __rhs
;
76 _LIBCPP_END_NAMESPACE_FILESYSTEM
78 #endif // _LIBCPP_CXX03_LANG
80 #endif // _LIBCPP___FILESYSTEM_COPY_OPTIONS_H