1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
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
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
11 #define _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
12 
13 #include <__availability>
14 #include <__config>
15 
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 #  pragma GCC system_header
18 #endif
19 
20 #ifndef _LIBCPP_CXX03_LANG
21 
22 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
23 
24 enum class _LIBCPP_ENUM_VIS copy_options : unsigned short {
25   none = 0,
26   skip_existing = 1,
27   overwrite_existing = 2,
28   update_existing = 4,
29   recursive = 8,
30   copy_symlinks = 16,
31   skip_symlinks = 32,
32   directories_only = 64,
33   create_symlinks = 128,
34   create_hard_links = 256,
35   __in_recursive_copy = 512,
36 };
37 
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));
42 }
43 
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));
48 }
49 
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));
54 }
55 
56 _LIBCPP_INLINE_VISIBILITY
57 inline constexpr copy_options operator~(copy_options __lhs) {
58   return static_cast<copy_options>(~static_cast<unsigned short>(__lhs));
59 }
60 
61 _LIBCPP_INLINE_VISIBILITY
62 inline copy_options& operator&=(copy_options& __lhs, copy_options __rhs) {
63   return __lhs = __lhs & __rhs;
64 }
65 
66 _LIBCPP_INLINE_VISIBILITY
67 inline copy_options& operator|=(copy_options& __lhs, copy_options __rhs) {
68   return __lhs = __lhs | __rhs;
69 }
70 
71 _LIBCPP_INLINE_VISIBILITY
72 inline copy_options& operator^=(copy_options& __lhs, copy_options __rhs) {
73   return __lhs = __lhs ^ __rhs;
74 }
75 
76 _LIBCPP_END_NAMESPACE_FILESYSTEM
77 
78 #endif // _LIBCPP_CXX03_LANG
79 
80 #endif // _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
81