diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__filesystem/path.h')
| -rw-r--r-- | contrib/llvm-project/libcxx/include/__filesystem/path.h | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/contrib/llvm-project/libcxx/include/__filesystem/path.h b/contrib/llvm-project/libcxx/include/__filesystem/path.h index 4e6912fcf3e7..77699c5ae47f 100644 --- a/contrib/llvm-project/libcxx/include/__filesystem/path.h +++ b/contrib/llvm-project/libcxx/include/__filesystem/path.h @@ -14,12 +14,18 @@ #include <__algorithm/replace_copy.h> #include <__availability> #include <__config> +#include <__functional/hash.h> +#include <__functional/unary_function.h> +#include <__fwd/hash.h> #include <__iterator/back_insert_iterator.h> #include <__iterator/iterator_traits.h> +#include <__type_traits/decay.h> +#include <__type_traits/is_pointer.h> +#include <__type_traits/remove_const.h> +#include <__type_traits/remove_pointer.h> #include <cstddef> #include <string> #include <string_view> -#include <type_traits> #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include <iomanip> // for quoted @@ -34,7 +40,7 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM -_LIBCPP_AVAILABILITY_FILESYSTEM_PUSH +_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH template <class _Tp> struct __can_convert_char { @@ -139,7 +145,7 @@ struct __is_pathable_string< } }; -template <class _Source, class _DS = typename decay<_Source>::type, +template <class _Source, class _DS = __decay_t<_Source>, class _UnqualPtrType = __remove_const_t<__remove_pointer_t<_DS> >, bool _IsCharPtr = is_pointer<_DS>::value&& @@ -168,7 +174,7 @@ struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true> static _ECharT __first_or_null(const _ECharT* __b) { return *__b; } }; -template <class _Iter, bool _IsIt = __is_cpp17_input_iterator<_Iter>::value, +template <class _Iter, bool _IsIt = __has_input_iterator_category<_Iter>::value, class = void> struct __is_pathable_iter : false_type {}; @@ -217,10 +223,8 @@ typedef char __path_value; #endif #if defined(_LIBCPP_WIN32API) -_LIBCPP_FUNC_VIS -size_t __wide_to_char(const wstring&, char*, size_t); -_LIBCPP_FUNC_VIS -size_t __char_to_wide(const string&, wchar_t*, size_t); +_LIBCPP_EXPORTED_FROM_ABI size_t __wide_to_char(const wstring&, char*, size_t); +_LIBCPP_EXPORTED_FROM_ABI size_t __char_to_wide(const string&, wchar_t*, size_t); #endif template <class _ECharT> @@ -303,7 +307,7 @@ struct _PathCVT<__path_value> { template <class _Iter> _LIBCPP_HIDE_FROM_ABI - static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type + static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type __append_range(__path_string& __dest, _Iter __b, _Iter __e) { for (; __b != __e; ++__b) __dest.push_back(*__b); @@ -311,7 +315,7 @@ struct _PathCVT<__path_value> { template <class _Iter> _LIBCPP_HIDE_FROM_ABI - static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type + static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type __append_range(__path_string& __dest, _Iter __b, _Iter __e) { __dest.append(__b, __e); } @@ -348,7 +352,7 @@ struct _PathCVT<char> { template <class _Iter> _LIBCPP_HIDE_FROM_ABI - static typename enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type + static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type __append_range(__path_string& __dest, _Iter __b, _Iter __e) { basic_string<char> __tmp(__b, __e); __append_string(__dest, __tmp); @@ -356,7 +360,7 @@ struct _PathCVT<char> { template <class _Iter> _LIBCPP_HIDE_FROM_ABI - static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type + static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type __append_range(__path_string& __dest, _Iter __b, _Iter __e) { basic_string<char> __tmp(__b, __e); __append_string(__dest, __tmp); @@ -439,7 +443,7 @@ struct _PathExport<char8_t> { #endif /* !_LIBCPP_HAS_NO_CHAR8_T */ #endif /* _LIBCPP_WIN32API */ -class _LIBCPP_TYPE_VIS path { +class _LIBCPP_EXPORTED_FROM_ABI path { template <class _SourceOrIter, class _Tp = path&> using _EnableIfPathable = typename enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type; @@ -1029,7 +1033,7 @@ public: } // iterators - class _LIBCPP_TYPE_VIS iterator; + class _LIBCPP_EXPORTED_FROM_ABI iterator; typedef iterator const_iterator; iterator begin() const; @@ -1079,13 +1083,23 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); } -_LIBCPP_FUNC_VIS -size_t hash_value(const path& __p) noexcept; +_LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept; -_LIBCPP_AVAILABILITY_FILESYSTEM_POP +_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP _LIBCPP_END_NAMESPACE_FILESYSTEM +_LIBCPP_BEGIN_NAMESPACE_STD + +template <> +struct _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY hash<_VSTD_FS::path> : __unary_function<_VSTD_FS::path, size_t> { + _LIBCPP_HIDE_FROM_ABI size_t operator()(_VSTD_FS::path const& __p) const noexcept { + return _VSTD_FS::hash_value(__p); + } +}; + +_LIBCPP_END_NAMESPACE_STD + #endif // _LIBCPP_CXX03_LANG #endif // _LIBCPP___FILESYSTEM_PATH_H |
