Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / include / __filesystem / copy_options.h
blob097eebe61137d7826ae3291ab11a31eb3115ca65
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 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
11 #define _LIBCPP___FILESYSTEM_COPY_OPTIONS_H
13 #include <__config>
15 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16 # pragma GCC system_header
17 #endif
19 #if _LIBCPP_STD_VER >= 17
21 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
23 enum class copy_options : unsigned short {
24 none = 0,
25 skip_existing = 1,
26 overwrite_existing = 2,
27 update_existing = 4,
28 recursive = 8,
29 copy_symlinks = 16,
30 skip_symlinks = 32,
31 directories_only = 64,
32 create_symlinks = 128,
33 create_hard_links = 256,
34 __in_recursive_copy = 512,
37 _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator&(copy_options __lhs, copy_options __rhs) {
38 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) & static_cast<unsigned short>(__rhs));
41 _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator|(copy_options __lhs, copy_options __rhs) {
42 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) | static_cast<unsigned short>(__rhs));
45 _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator^(copy_options __lhs, copy_options __rhs) {
46 return static_cast<copy_options>(static_cast<unsigned short>(__lhs) ^ static_cast<unsigned short>(__rhs));
49 _LIBCPP_HIDE_FROM_ABI inline constexpr copy_options operator~(copy_options __lhs) {
50 return static_cast<copy_options>(~static_cast<unsigned short>(__lhs));
53 _LIBCPP_HIDE_FROM_ABI inline copy_options& operator&=(copy_options& __lhs, copy_options __rhs) {
54 return __lhs = __lhs & __rhs;
57 _LIBCPP_HIDE_FROM_ABI inline copy_options& operator|=(copy_options& __lhs, copy_options __rhs) {
58 return __lhs = __lhs | __rhs;
61 _LIBCPP_HIDE_FROM_ABI inline copy_options& operator^=(copy_options& __lhs, copy_options __rhs) {
62 return __lhs = __lhs ^ __rhs;
65 _LIBCPP_END_NAMESPACE_FILESYSTEM
67 #endif // _LIBCPP_STD_VER >= 17
69 #endif // _LIBCPP___FILESYSTEM_COPY_OPTIONS_H