30 #ifndef _GLIBCXX_EXPERIMENTAL_FS_PATH_H 31 #define _GLIBCXX_EXPERIMENTAL_FS_PATH_H 1 33 #if __cplusplus < 201103L 47 #if __cplusplus == 201402L 51 #if defined(_WIN32) && !defined(__CYGWIN__) 52 # define _GLIBCXX_FILESYSTEM_IS_WINDOWS 1 56 namespace std _GLIBCXX_VISIBILITY(default)
58 _GLIBCXX_BEGIN_NAMESPACE_VERSION
60 namespace experimental
66 _GLIBCXX_BEGIN_NAMESPACE_CXX11
68 #if __cplusplus == 201402L 69 using std::experimental::basic_string_view;
70 #elif __cplusplus > 201402L 71 using std::basic_string_view;
82 template<
typename _CharT,
83 typename _Ch =
typename remove_const<_CharT>::type>
84 using __is_encoded_char
85 = __or_<is_same<_Ch, char>,
87 #ifdef _GLIBCXX_USE_CHAR8_T 93 template<
typename _Iter,
94 typename _Iter_traits = std::iterator_traits<_Iter>>
95 using __is_path_iter_src
96 = __and_<__is_encoded_char<typename _Iter_traits::value_type>,
98 typename _Iter_traits::iterator_category>>;
100 template<
typename _Iter>
101 static __is_path_iter_src<_Iter>
102 __is_path_src(_Iter,
int);
104 template<
typename _CharT,
typename _Traits,
typename _Alloc>
105 static __is_encoded_char<_CharT>
108 #if __cplusplus >= 201402L 109 template<
typename _CharT,
typename _Traits>
110 static __is_encoded_char<_CharT>
111 __is_path_src(
const basic_string_view<_CharT, _Traits>&,
int);
114 template<
typename _Unknown>
116 __is_path_src(
const _Unknown&, ...);
118 template<
typename _Tp1,
typename _Tp2>
119 struct __constructible_from;
121 template<
typename _Iter>
122 struct __constructible_from<_Iter, _Iter>
123 : __is_path_iter_src<_Iter>
126 template<
typename _Source>
127 struct __constructible_from<_Source, void>
128 : decltype(__is_path_src(std::declval<_Source>(), 0))
131 template<
typename _Tp1,
typename _Tp2 =
void>
132 using _Path =
typename 135 __not_<is_void<_Tp1>>,
136 __constructible_from<_Tp1, _Tp2>>::value,
139 template<
typename _Source>
141 _S_range_begin(_Source __begin) {
return __begin; }
143 struct __null_terminated { };
145 template<
typename _Source>
146 static __null_terminated
147 _S_range_end(_Source) {
return {}; }
149 template<
typename _CharT,
typename _Traits,
typename _Alloc>
152 {
return __str.
data(); }
154 template<
typename _CharT,
typename _Traits,
typename _Alloc>
157 {
return __str.
data() + __str.
size(); }
159 #if __cplusplus >= 201402L 160 template<
typename _CharT,
typename _Traits>
162 _S_range_begin(
const basic_string_view<_CharT, _Traits>& __str)
163 {
return __str.data(); }
165 template<
typename _CharT,
typename _Traits>
167 _S_range_end(
const basic_string_view<_CharT, _Traits>& __str)
168 {
return __str.data() + __str.size(); }
171 template<
typename _Tp,
172 typename _Iter = decltype(_S_range_begin(std::declval<_Tp>())),
173 typename _Val =
typename std::iterator_traits<_Iter>::value_type>
179 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 180 typedef wchar_t value_type;
181 static constexpr value_type preferred_separator = L
'\\';
183 typedef char value_type;
184 static constexpr value_type preferred_separator =
'/';
195 : _M_pathname(std::move(__p._M_pathname)), _M_type(__p._M_type)
202 : _M_pathname(std::move(__source))
203 { _M_split_cmpts(); }
205 template<
typename _Source,
206 typename _Require = _Path<_Source>>
207 path(_Source
const& __source)
208 : _M_pathname(_S_convert(_S_range_begin(__source),
209 _S_range_end(__source)))
210 { _M_split_cmpts(); }
212 template<
typename _InputIterator,
213 typename _Require = _Path<_InputIterator, _InputIterator>>
214 path(_InputIterator __first, _InputIterator __last)
215 : _M_pathname(_S_convert(__first, __last))
216 { _M_split_cmpts(); }
218 template<
typename _Source,
219 typename _Require = _Path<_Source>,
220 typename _Require2 = __value_type_is_char<_Source>>
221 path(_Source
const& __source,
const locale& __loc)
222 : _M_pathname(_S_convert_loc(_S_range_begin(__source),
223 _S_range_end(__source), __loc))
224 { _M_split_cmpts(); }
226 template<
typename _InputIterator,
227 typename _Require = _Path<_InputIterator, _InputIterator>,
228 typename _Require2 = __value_type_is_char<_InputIterator>>
229 path(_InputIterator __first, _InputIterator __last,
const locale& __loc)
230 : _M_pathname(_S_convert_loc(__first, __last, __loc))
231 { _M_split_cmpts(); }
237 path& operator=(
const path& __p) =
default;
238 path& operator=(
path&& __p) noexcept;
242 template<
typename _Source>
244 operator=(_Source
const& __source)
245 {
return *
this =
path(__source); }
247 template<
typename _Source>
249 assign(_Source
const& __source)
250 {
return *
this =
path(__source); }
252 template<
typename _InputIterator>
253 _Path<_InputIterator, _InputIterator>&
254 assign(_InputIterator __first, _InputIterator __last)
255 {
return *
this =
path(__first, __last); }
259 path& operator/=(
const path& __p) {
return _M_append(__p._M_pathname); }
261 template <
class _Source>
263 operator/=(_Source
const& __source)
264 {
return append(__source); }
266 template<
typename _Source>
268 append(_Source
const& __source)
270 return _M_append(_S_convert(_S_range_begin(__source),
271 _S_range_end(__source)));
274 template<
typename _InputIterator>
275 _Path<_InputIterator, _InputIterator>&
276 append(_InputIterator __first, _InputIterator __last)
277 {
return _M_append(_S_convert(__first, __last)); }
283 path& operator+=(
const value_type* __x);
284 path& operator+=(value_type __x);
285 #if __cplusplus >= 201402L 286 path& operator+=(basic_string_view<value_type> __x);
289 template<
typename _Source>
291 operator+=(_Source
const& __x) {
return concat(__x); }
293 template<
typename _CharT>
294 _Path<_CharT*, _CharT*>&
295 operator+=(_CharT __x);
297 template<
typename _Source>
299 concat(_Source
const& __x)
300 {
return *
this += _S_convert(_S_range_begin(__x), _S_range_end(__x)); }
302 template<
typename _InputIterator>
303 _Path<_InputIterator, _InputIterator>&
304 concat(_InputIterator __first, _InputIterator __last)
305 {
return *
this += _S_convert(__first, __last); }
309 void clear() noexcept { _M_pathname.
clear(); _M_split_cmpts(); }
311 path& make_preferred();
312 path& remove_filename();
313 path& replace_filename(
const path& __replacement);
314 path& replace_extension(
const path& __replacement =
path());
316 void swap(
path& __rhs) noexcept;
320 const string_type& native()
const noexcept {
return _M_pathname; }
321 const value_type* c_str()
const noexcept {
return _M_pathname.
c_str(); }
322 operator string_type()
const {
return _M_pathname; }
324 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
325 typename _Allocator = std::allocator<_CharT>>
327 string(
const _Allocator& __a = _Allocator())
const;
330 #if _GLIBCXX_USE_WCHAR_T 333 #ifdef _GLIBCXX_USE_CHAR8_T 334 __attribute__((__abi_tag__(
"__u8")))
335 std::u8string u8string()
const;
338 #endif // _GLIBCXX_USE_CHAR8_T 343 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
344 typename _Allocator = std::allocator<_CharT>>
346 generic_string(
const _Allocator& __a = _Allocator())
const;
349 #if _GLIBCXX_USE_WCHAR_T 352 #ifdef _GLIBCXX_USE_CHAR8_T 353 __attribute__((__abi_tag__(
"__u8")))
354 std::u8string generic_u8string()
const;
357 #endif // _GLIBCXX_USE_CHAR8_T 363 int compare(
const path& __p)
const noexcept;
365 int compare(
const value_type* __s)
const;
366 #if __cplusplus >= 201402L 367 int compare(
const basic_string_view<value_type> __s)
const;
372 path root_name()
const;
373 path root_directory()
const;
374 path root_path()
const;
375 path relative_path()
const;
376 path parent_path()
const;
377 path filename()
const;
379 path extension()
const;
383 _GLIBCXX_NODISCARD
bool empty()
const noexcept {
return _M_pathname.
empty(); }
384 bool has_root_name()
const;
385 bool has_root_directory()
const;
386 bool has_root_path()
const;
387 bool has_relative_path()
const;
388 bool has_parent_path()
const;
389 bool has_filename()
const;
390 bool has_stem()
const;
391 bool has_extension()
const;
392 bool is_absolute()
const;
393 bool is_relative()
const {
return !is_absolute(); }
403 template<
typename _InputIterator,
404 typename _Traits = std::iterator_traits<_InputIterator>,
406 =
typename std::remove_cv<typename _Traits::value_type>::type>
408 _S_string_from_iter(_InputIterator __source)
411 for (_CharT __ch = *__source; __ch != _CharT(); __ch = *++__source)
417 enum class _Type : unsigned char {
418 _Multi, _Root_name, _Root_dir, _Filename
421 path(
string_type __str, _Type __type) : _M_pathname(__str), _M_type(__type)
423 __glibcxx_assert(!empty());
424 __glibcxx_assert(_M_type != _Type::_Multi);
427 enum class _Split { _Stem, _Extension };
431 if (!_M_pathname.
empty() && !_S_is_dir_sep(_M_pathname.
back())
432 && !__str.
empty() && !_S_is_dir_sep(__str.
front()))
433 _M_pathname += preferred_separator;
434 _M_pathname += __str;
441 template<
typename _CharT>
445 _S_convert(value_type* __src, __null_terminated)
449 _S_convert(
const value_type* __src, __null_terminated)
452 template<
typename _Iter>
454 _S_convert(_Iter __first, _Iter __last)
456 using __value_type =
typename std::iterator_traits<_Iter>::value_type;
457 return _Cvt<typename remove_cv<__value_type>::type>::
458 _S_convert(__first, __last);
461 template<
typename _InputIterator>
463 _S_convert(_InputIterator __src, __null_terminated)
465 auto __s = _S_string_from_iter(__src);
466 return _S_convert(__s.c_str(), __s.c_str() + __s.size());
470 _S_convert_loc(
const char* __first,
const char* __last,
473 template<
typename _Iter>
475 _S_convert_loc(_Iter __first, _Iter __last,
const std::locale& __loc)
478 return _S_convert_loc(__str.data(), __str.data()+__str.size(), __loc);
481 template<
typename _InputIterator>
483 _S_convert_loc(_InputIterator __src, __null_terminated,
487 return _S_convert_loc(__s.data(), __s.data() + __s.size(), __loc);
490 bool _S_is_dir_sep(value_type __ch)
492 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 493 return __ch == L
'/' || __ch == preferred_separator;
499 void _M_split_cmpts();
501 void _M_add_root_name(
size_t __n);
502 void _M_add_root_dir(
size_t __pos);
503 void _M_add_filename(
size_t __pos,
size_t __n);
508 using _List = _GLIBCXX_STD_C::vector<_Cmpt>;
510 _Type _M_type = _Type::_Multi;
513 inline void swap(
path& __lhs,
path& __rhs) noexcept { __lhs.swap(__rhs); }
515 size_t hash_value(
const path& __p) noexcept;
518 inline bool operator<(
const path& __lhs,
const path& __rhs) noexcept
519 {
return __lhs.compare(__rhs) < 0; }
522 inline bool operator<=(
const path& __lhs,
const path& __rhs) noexcept
523 {
return !(__rhs < __lhs); }
526 inline bool operator>(
const path& __lhs,
const path& __rhs) noexcept
527 {
return __rhs < __lhs; }
530 inline bool operator>=(
const path& __lhs,
const path& __rhs) noexcept
531 {
return !(__lhs < __rhs); }
534 inline bool operator==(
const path& __lhs,
const path& __rhs) noexcept
535 {
return __lhs.compare(__rhs) == 0; }
538 inline bool operator!=(
const path& __lhs,
const path& __rhs) noexcept
539 {
return !(__lhs == __rhs); }
544 path __result(__lhs);
550 template<
typename _CharT,
typename _Traits>
554 auto __tmp = __p.string<_CharT, _Traits>();
555 using __quoted_string
557 __os << __quoted_string{__tmp, _CharT(
'"'), _CharT(
'\\')};
562 template<
typename _CharT,
typename _Traits>
567 using __quoted_string
569 if (__is >> __quoted_string{ __tmp, _CharT(
'"'), _CharT(
'\\') })
570 __p = std::move(__tmp);
575 template<
typename _Source>
579 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 582 return path{ __source };
587 template<
typename _InputIterator>
589 u8path(_InputIterator __first, _InputIterator __last)
591 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 594 return path{ __first, __last };
601 filesystem_error(
const string& __what_arg,
error_code __ec)
604 filesystem_error(
const string& __what_arg,
const path& __p1,
608 filesystem_error(
const string& __what_arg,
const path& __p1,
610 :
system_error(__ec, __what_arg), _M_path1(__p1), _M_path2(__p2)
615 const path& path1() const noexcept {
return _M_path1; }
616 const path& path2() const noexcept {
return _M_path2; }
617 const char* what() const noexcept {
return _M_what.c_str(); }
627 struct path::_Cmpt : path
629 _Cmpt(string_type __s, _Type __t,
size_t __pos)
630 : path(
std::move(__s), __t), _M_pos(__pos) { }
632 _Cmpt() : _M_pos(-1) { }
639 struct path::_Cvt<path::value_type>
641 template<
typename _Iter>
643 _S_convert(_Iter __first, _Iter __last)
644 {
return string_type{__first, __last}; }
647 template<
typename _CharT>
650 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 652 _S_wconvert(
const char* __f,
const char* __l,
true_type)
655 const auto& __cvt = std::use_facet<_Cvt>(
std::locale{});
657 if (__str_codecvt_in(__f, __l, __wstr, __cvt))
659 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
660 "Cannot convert character sequence",
661 std::make_error_code(errc::illegal_byte_sequence)));
665 _S_wconvert(
const _CharT* __f,
const _CharT* __l,
false_type)
667 std::codecvt_utf8<_CharT> __cvt;
669 if (__str_codecvt_out(__f, __l, __str, __cvt))
671 const char* __f2 = __str.
data();
672 const char* __l2 = __f2 + __str.size();
673 std::codecvt_utf8<wchar_t> __wcvt;
675 if (__str_codecvt_in(__f2, __l2, __wstr, __wcvt))
678 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
679 "Cannot convert character sequence",
680 std::make_error_code(errc::illegal_byte_sequence)));
684 _S_convert(
const _CharT* __f,
const _CharT* __l)
686 return _S_wconvert(__f, __l, is_same<_CharT, char>{});
690 _S_convert(
const _CharT* __f,
const _CharT* __l)
692 #ifdef _GLIBCXX_USE_CHAR8_T 693 if constexpr (is_same<_CharT, char8_t>::value)
695 string_type __str(__f, __l);
701 std::codecvt_utf8<_CharT> __cvt;
703 if (__str_codecvt_out(__f, __l, __str, __cvt))
705 #ifdef _GLIBCXX_USE_CHAR8_T 708 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
709 "Cannot convert character sequence",
710 std::make_error_code(errc::illegal_byte_sequence)));
715 _S_convert(_CharT* __f, _CharT* __l)
717 return _S_convert(const_cast<const _CharT*>(__f),
718 const_cast<const _CharT*>(__l));
721 template<
typename _Iter>
723 _S_convert(_Iter __first, _Iter __last)
726 return _S_convert(__str.data(), __str.data() + __str.size());
729 template<
typename _Iter,
typename _Cont>
731 _S_convert(__gnu_cxx::__normal_iterator<_Iter, _Cont> __first,
732 __gnu_cxx::__normal_iterator<_Iter, _Cont> __last)
733 {
return _S_convert(__first.base(), __last.base()); }
740 using difference_type = std::ptrdiff_t;
746 iterator() : _M_path(
nullptr), _M_cur(), _M_at_end() { }
755 iterator operator++(
int) {
auto __tmp = *
this; ++*
this;
return __tmp; }
758 iterator operator--(
int) {
auto __tmp = *
this; --*
this;
return __tmp; }
761 {
return __lhs._M_equals(__rhs); }
764 {
return !__lhs._M_equals(__rhs); }
769 iterator(
const path* __path, path::_List::const_iterator __iter)
770 : _M_path(__path), _M_cur(__iter), _M_at_end()
774 : _M_path(__path), _M_cur(), _M_at_end(__at_end)
780 path::_List::const_iterator _M_cur;
786 path::operator=(
path&& __p) noexcept
788 _M_pathname = std::move(__p._M_pathname);
789 _M_cmpts = std::move(__p._M_cmpts);
790 _M_type = __p._M_type;
796 path::operator=(string_type&& __source)
797 {
return *
this =
path(std::move(__source)); }
800 path::assign(string_type&& __source)
801 {
return *
this = path(std::move(__source)); }
804 path::operator+=(
const path& __p)
806 return operator+=(__p.native());
810 path::operator+=(
const string_type& __x)
818 path::operator+=(
const value_type* __x)
826 path::operator+=(value_type __x)
833 #if __cplusplus >= 201402L 835 path::operator+=(basic_string_view<value_type> __x)
837 _M_pathname.
append(__x.data(), __x.size());
843 template<
typename _CharT>
844 inline path::_Path<_CharT*, _CharT*>&
845 path::operator+=(_CharT __x)
848 return concat(__addr, __addr + 1);
852 path::make_preferred()
854 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 856 preferred_separator);
861 inline void path::swap(path& __rhs) noexcept
863 _M_pathname.swap(__rhs._M_pathname);
864 _M_cmpts.swap(__rhs._M_cmpts);
865 std::swap(_M_type, __rhs._M_type);
868 template<
typename _CharT,
typename _Traits,
typename _Allocator>
872 if (is_same<_CharT, value_type>::value)
873 return { _M_pathname.
begin(), _M_pathname.
end(), __a };
875 const value_type* __first = _M_pathname.
data();
876 const value_type* __last = __first + _M_pathname.
size();
878 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 879 using _CharAlloc = __alloc_rebind<_Allocator, char>;
880 using _String = basic_string<char, char_traits<char>, _CharAlloc>;
881 using _WString = basic_string<_CharT, _Traits, _Allocator>;
884 codecvt_utf8<value_type> __cvt;
885 _String __u8str{_CharAlloc{__a}};
886 if (__str_codecvt_out(__first, __last, __u8str, __cvt))
891 operator()(
const _String& __from, _String&,
true_type)
895 operator()(
const _String& __from, _WString& __to,
false_type)
897 #ifdef _GLIBCXX_USE_CHAR8_T 898 if constexpr (is_same<_CharT, char8_t>::value)
900 __to.assign(__from.begin(), __from.end());
907 codecvt_utf8<_CharT> __cvt;
908 const char* __f = __from.data();
909 const char* __l = __f + __from.size();
910 if (__str_codecvt_in(__f, __l, __to, __cvt))
912 #ifdef _GLIBCXX_USE_CHAR8_T 919 if (
auto* __p = __dispatch(__u8str, __wstr, is_same<_CharT, char>{}))
923 #ifdef _GLIBCXX_USE_CHAR8_T 924 if constexpr (is_same<_CharT, char8_t>::value)
926 basic_string<_CharT, _Traits, _Allocator> __wstr{__first, __last, __a};
932 codecvt_utf8<_CharT> __cvt;
933 basic_string<_CharT, _Traits, _Allocator> __wstr{__a};
934 if (__str_codecvt_in(__first, __last, __wstr, __cvt))
936 #ifdef _GLIBCXX_USE_CHAR8_T 940 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
941 "Cannot convert character sequence",
942 std::make_error_code(errc::illegal_byte_sequence)));
948 #if _GLIBCXX_USE_WCHAR_T 953 #ifdef _GLIBCXX_USE_CHAR8_T 955 path::u8string()
const {
return string<char8_t>(); }
958 path::u8string()
const 960 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 963 codecvt_utf8<value_type> __cvt;
964 const value_type* __first = _M_pathname.
data();
965 const value_type* __last = __first + _M_pathname.
size();
966 if (__str_codecvt_out(__first, __last, __str, __cvt))
968 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
969 "Cannot convert character sequence",
970 std::make_error_code(errc::illegal_byte_sequence)));
975 #endif // _GLIBCXX_USE_CHAR8_T 983 #ifndef _GLIBCXX_FILESYSTEM_IS_WINDOWS 984 template<
typename _CharT,
typename _Traits,
typename _Allocator>
986 path::generic_string(
const _Allocator& __a)
const 987 {
return string<_CharT, _Traits, _Allocator>(__a); }
990 path::generic_string()
const {
return string(); }
992 #if _GLIBCXX_USE_WCHAR_T 994 path::generic_wstring()
const {
return wstring(); }
997 #ifdef _GLIBCXX_USE_CHAR8_T 999 path::generic_u8string()
const {
return u8string(); }
1002 path::generic_u8string()
const {
return u8string(); }
1006 path::generic_u16string()
const {
return u16string(); }
1009 path::generic_u32string()
const {
return u32string(); }
1013 path::compare(
const string_type& __s)
const {
return compare(path(__s)); }
1016 path::compare(
const value_type* __s)
const {
return compare(path(__s)); }
1018 #if __cplusplus >= 201402L 1020 path::compare(basic_string_view<value_type> __s)
const 1021 {
return compare(path(__s)); }
1025 path::filename()
const {
return empty() ? path() : *--
end(); }
1030 auto ext = _M_find_extension();
1031 if (ext.first && ext.second != 0)
1032 return path{ext.first->substr(0, ext.second)};
1037 path::extension()
const 1039 auto ext = _M_find_extension();
1041 return path{ext.first->substr(ext.second)};
1046 path::has_stem()
const 1048 auto ext = _M_find_extension();
1049 return ext.first && ext.second != 0;
1053 path::has_extension()
const 1055 auto ext = _M_find_extension();
1060 path::is_absolute()
const 1062 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 1063 return has_root_name() && has_root_directory();
1065 return has_root_directory();
1069 inline path::iterator
1072 if (_M_type == _Type::_Multi)
1073 return iterator(
this, _M_cmpts.
begin());
1074 return iterator(
this,
false);
1077 inline path::iterator
1080 if (_M_type == _Type::_Multi)
1081 return iterator(
this, _M_cmpts.
end());
1082 return iterator(
this,
true);
1085 inline path::iterator&
1086 path::iterator::operator++()
1088 __glibcxx_assert(_M_path !=
nullptr);
1089 if (_M_path->_M_type == _Type::_Multi)
1091 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.
end());
1096 __glibcxx_assert(!_M_at_end);
1102 inline path::iterator&
1103 path::iterator::operator--()
1105 __glibcxx_assert(_M_path !=
nullptr);
1106 if (_M_path->_M_type == _Type::_Multi)
1108 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.begin());
1113 __glibcxx_assert(_M_at_end);
1119 inline path::iterator::reference
1120 path::iterator::operator*()
const 1122 __glibcxx_assert(_M_path !=
nullptr);
1123 if (_M_path->_M_type == _Type::_Multi)
1125 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.end());
1132 path::iterator::_M_equals(iterator __rhs)
const 1134 if (_M_path != __rhs._M_path)
1136 if (_M_path ==
nullptr)
1138 if (_M_path->_M_type == path::_Type::_Multi)
1139 return _M_cur == __rhs._M_cur;
1140 return _M_at_end == __rhs._M_at_end;
1144 _GLIBCXX_END_NAMESPACE_CXX11
1149 _GLIBCXX_END_NAMESPACE_VERSION
1154 #endif // _GLIBCXX_EXPERIMENTAL_FS_PATH_H Template class basic_istream.
Thrown to indicate error code of underlying system.
Define a member typedef type only if a boolean constant is true.
_GLIBCXX20_CONSTEXPR complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list.
path u8path(const _Source &__source)
Compare paths.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
ISO C++ entities toplevel namespace is std.
basic_string< char16_t > u16string
A string of char16_t.
basic_string< wchar_t > wstring
A string of wchar_t.
An iterator for the components of a path.
_GLIBCXX_END_NAMESPACE_CXX11 typedef basic_string< char > string
A string of char.
Managing sequences of characters and character-like objects.
iterator begin() noexcept
Container class for localization functionality.The locale class is first a class wrapper for C librar...
const _CharT * data() const noexcept
Return const pointer to contents.
basic_string & append(const basic_string &__str)
Append a string to this string.
Template class basic_ostream.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
Class codecvt<wchar_t, char, mbstate_t> specialization.
_GLIBCXX_NODISCARD bool empty() const noexcept
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
basic_string< char32_t > u32string
A string of char32_t.
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
Struct for delimited strings.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
Struct holding two objects of arbitrary type.
Bidirectional iterators support a superset of forward iterator operations.
void push_back(_CharT __c)
Append a single character.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
static const size_type npos
Value returned by various member functions when they fail.
void replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__old_value, const _Tp &__new_value)
Replace each occurrence of one value in a sequence with another value.