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>
85 template<
typename _Iter,
86 typename _Iter_traits = std::iterator_traits<_Iter>>
87 using __is_path_iter_src
88 = __and_<__is_encoded_char<typename _Iter_traits::value_type>,
90 typename _Iter_traits::iterator_category>>;
92 template<
typename _Iter>
93 static __is_path_iter_src<_Iter>
94 __is_path_src(_Iter,
int);
96 template<
typename _CharT,
typename _Traits,
typename _Alloc>
97 static __is_encoded_char<_CharT>
100 #if __cplusplus >= 201402L 101 template<
typename _CharT,
typename _Traits>
102 static __is_encoded_char<_CharT>
103 __is_path_src(
const basic_string_view<_CharT, _Traits>&,
int);
106 template<
typename _Unknown>
108 __is_path_src(
const _Unknown&, ...);
110 template<
typename _Tp1,
typename _Tp2>
111 struct __constructible_from;
113 template<
typename _Iter>
114 struct __constructible_from<_Iter, _Iter>
115 : __is_path_iter_src<_Iter>
118 template<
typename _Source>
119 struct __constructible_from<_Source, void>
120 : decltype(__is_path_src(std::declval<_Source>(), 0))
123 template<
typename _Tp1,
typename _Tp2 = void,
124 typename _Tp1_nocv =
typename remove_cv<_Tp1>::type,
125 typename _Tp1_noptr =
typename remove_pointer<_Tp1>::type>
126 using _Path =
typename 128 __not_<is_void<_Tp1_noptr>>,
129 __constructible_from<_Tp1, _Tp2>>::value,
132 template<
typename _Source>
134 _S_range_begin(_Source __begin) {
return __begin; }
136 struct __null_terminated { };
138 template<
typename _Source>
139 static __null_terminated
140 _S_range_end(_Source) {
return {}; }
142 template<
typename _CharT,
typename _Traits,
typename _Alloc>
145 {
return __str.
data(); }
147 template<
typename _CharT,
typename _Traits,
typename _Alloc>
150 {
return __str.
data() + __str.
size(); }
152 #if __cplusplus >= 201402L 153 template<
typename _CharT,
typename _Traits>
155 _S_range_begin(
const basic_string_view<_CharT, _Traits>& __str)
156 {
return __str.data(); }
158 template<
typename _CharT,
typename _Traits>
160 _S_range_end(
const basic_string_view<_CharT, _Traits>& __str)
161 {
return __str.data() + __str.size(); }
164 template<
typename _Tp,
165 typename _Iter = decltype(_S_range_begin(std::declval<_Tp>())),
166 typename _Val =
typename std::iterator_traits<_Iter>::value_type>
167 using __value_type_is_char
171 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 172 typedef wchar_t value_type;
173 static constexpr value_type preferred_separator = L
'\\';
175 typedef char value_type;
176 static constexpr value_type preferred_separator =
'/';
187 : _M_pathname(std::move(__p._M_pathname)), _M_type(__p._M_type)
189 if (_M_type == _Type::_Multi)
195 : _M_pathname(std::move(__source))
196 { _M_split_cmpts(); }
198 template<
typename _Source,
199 typename _Require = _Path<_Source>>
200 path(_Source
const& __source)
201 : _M_pathname(_S_convert(_S_range_begin(__source),
202 _S_range_end(__source)))
203 { _M_split_cmpts(); }
205 template<
typename _InputIterator,
206 typename _Require = _Path<_InputIterator, _InputIterator>>
207 path(_InputIterator __first, _InputIterator __last)
208 : _M_pathname(_S_convert(__first, __last))
209 { _M_split_cmpts(); }
211 template<
typename _Source,
212 typename _Require = _Path<_Source>,
213 typename _Require2 = __value_type_is_char<_Source>>
214 path(_Source
const& __source,
const locale& __loc)
215 : _M_pathname(_S_convert_loc(_S_range_begin(__source),
216 _S_range_end(__source), __loc))
217 { _M_split_cmpts(); }
219 template<
typename _InputIterator,
220 typename _Require = _Path<_InputIterator, _InputIterator>,
221 typename _Require2 = __value_type_is_char<_InputIterator>>
222 path(_InputIterator __first, _InputIterator __last,
const locale& __loc)
223 : _M_pathname(_S_convert_loc(__first, __last, __loc))
224 { _M_split_cmpts(); }
230 path& operator=(
const path& __p) =
default;
231 path& operator=(
path&& __p) noexcept;
235 template<
typename _Source>
237 operator=(_Source
const& __source)
238 {
return *
this =
path(__source); }
240 template<
typename _Source>
242 assign(_Source
const& __source)
243 {
return *
this =
path(__source); }
245 template<
typename _InputIterator>
246 _Path<_InputIterator, _InputIterator>&
247 assign(_InputIterator __first, _InputIterator __last)
248 {
return *
this =
path(__first, __last); }
252 path& operator/=(
const path& __p) {
return _M_append(__p._M_pathname); }
254 template <
class _Source>
256 operator/=(_Source
const& __source)
257 {
return append(__source); }
259 template<
typename _Source>
261 append(_Source
const& __source)
263 return _M_append(_S_convert(_S_range_begin(__source),
264 _S_range_end(__source)));
267 template<
typename _InputIterator>
268 _Path<_InputIterator, _InputIterator>&
269 append(_InputIterator __first, _InputIterator __last)
270 {
return _M_append(_S_convert(__first, __last)); }
276 path& operator+=(
const value_type* __x);
277 path& operator+=(value_type __x);
278 #if __cplusplus >= 201402L 279 path& operator+=(basic_string_view<value_type> __x);
282 template<
typename _Source>
284 operator+=(_Source
const& __x) {
return concat(__x); }
286 template<
typename _CharT>
287 _Path<_CharT*, _CharT*>&
288 operator+=(_CharT __x);
290 template<
typename _Source>
292 concat(_Source
const& __x)
293 {
return *
this += _S_convert(_S_range_begin(__x), _S_range_end(__x)); }
295 template<
typename _InputIterator>
296 _Path<_InputIterator, _InputIterator>&
297 concat(_InputIterator __first, _InputIterator __last)
298 {
return *
this += _S_convert(__first, __last); }
302 void clear() noexcept { _M_pathname.
clear(); _M_split_cmpts(); }
304 path& make_preferred();
305 path& remove_filename();
306 path& replace_filename(
const path& __replacement);
307 path& replace_extension(
const path& __replacement =
path());
309 void swap(
path& __rhs) noexcept;
313 const string_type& native()
const noexcept {
return _M_pathname; }
314 const value_type* c_str()
const noexcept {
return _M_pathname.
c_str(); }
315 operator string_type()
const {
return _M_pathname; }
317 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
318 typename _Allocator = std::allocator<_CharT>>
320 string(
const _Allocator& __a = _Allocator())
const;
323 #if _GLIBCXX_USE_WCHAR_T 331 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT>,
332 typename _Allocator = std::allocator<_CharT>>
334 generic_string(
const _Allocator& __a = _Allocator())
const;
337 #if _GLIBCXX_USE_WCHAR_T 346 int compare(
const path& __p)
const noexcept;
348 int compare(
const value_type* __s)
const;
349 #if __cplusplus >= 201402L 350 int compare(
const basic_string_view<value_type> __s)
const;
355 path root_name()
const;
356 path root_directory()
const;
357 path root_path()
const;
358 path relative_path()
const;
359 path parent_path()
const;
360 path filename()
const;
362 path extension()
const;
366 bool empty()
const noexcept {
return _M_pathname.
empty(); }
367 bool has_root_name()
const;
368 bool has_root_directory()
const;
369 bool has_root_path()
const;
370 bool has_relative_path()
const;
371 bool has_parent_path()
const;
372 bool has_filename()
const;
373 bool has_stem()
const;
374 bool has_extension()
const;
375 bool is_absolute()
const {
return has_root_directory(); }
376 bool is_relative()
const {
return !is_absolute(); }
386 enum class _Type : unsigned char {
387 _Multi, _Root_name, _Root_dir, _Filename
390 path(
string_type __str, _Type __type) : _M_pathname(__str), _M_type(__type)
392 __glibcxx_assert(!empty());
393 __glibcxx_assert(_M_type != _Type::_Multi);
396 enum class _Split { _Stem, _Extension };
400 if (!_M_pathname.
empty() && !_S_is_dir_sep(_M_pathname.
back())
401 && !__str.
empty() && !_S_is_dir_sep(__str.
front()))
402 _M_pathname += preferred_separator;
403 _M_pathname += __str;
410 template<
typename _CharT>
414 _S_convert(value_type* __src, __null_terminated)
418 _S_convert(
const value_type* __src, __null_terminated)
421 template<
typename _Iter>
423 _S_convert(_Iter __first, _Iter __last)
425 using __value_type =
typename std::iterator_traits<_Iter>::value_type;
426 return _Cvt<typename remove_cv<__value_type>::type>::
427 _S_convert(__first, __last);
430 template<
typename _InputIterator>
432 _S_convert(_InputIterator __src, __null_terminated)
434 using _Tp =
typename std::iterator_traits<_InputIterator>::value_type;
436 for (; *__src != _Tp{}; ++__src)
442 _S_convert_loc(
const char* __first,
const char* __last,
445 template<
typename _Iter>
447 _S_convert_loc(_Iter __first, _Iter __last,
const std::locale& __loc)
450 return _S_convert_loc(__str.
data(), __str.
data()+__str.
size(), __loc);
453 template<
typename _InputIterator>
455 _S_convert_loc(_InputIterator __src, __null_terminated,
459 while (*__src !=
'\0')
461 return _S_convert_loc(__tmp.
data(), __tmp.
data()+__tmp.
size(), __loc);
464 static bool _S_is_dir_sep(value_type __ch)
466 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 467 return __ch == L
'/' || __ch == preferred_separator;
473 void _M_split_cmpts();
475 void _M_add_root_name(
size_t __n);
476 void _M_add_root_dir(
size_t __pos);
477 void _M_add_filename(
size_t __pos,
size_t __n);
482 using _List = _GLIBCXX_STD_C::vector<_Cmpt>;
484 _Type _M_type = _Type::_Multi;
487 inline void swap(
path& __lhs,
path& __rhs) noexcept { __lhs.swap(__rhs); }
489 size_t hash_value(
const path& __p) noexcept;
492 inline bool operator<(
const path& __lhs,
const path& __rhs) noexcept
493 {
return __lhs.compare(__rhs) < 0; }
496 inline bool operator<=(
const path& __lhs,
const path& __rhs) noexcept
497 {
return !(__rhs < __lhs); }
500 inline bool operator>(
const path& __lhs,
const path& __rhs) noexcept
501 {
return __rhs < __lhs; }
504 inline bool operator>=(
const path& __lhs,
const path& __rhs) noexcept
505 {
return !(__lhs < __rhs); }
508 inline bool operator==(
const path& __lhs,
const path& __rhs) noexcept
509 {
return __lhs.compare(__rhs) == 0; }
512 inline bool operator!=(
const path& __lhs,
const path& __rhs) noexcept
513 {
return !(__lhs == __rhs); }
518 path __result(__lhs);
524 template<
typename _CharT,
typename _Traits>
528 auto __tmp = __p.string<_CharT, _Traits>();
529 using __quoted_string
531 __os << __quoted_string{__tmp,
'"',
'\\'};
536 template<
typename _CharT,
typename _Traits>
541 using __quoted_string
543 if (__is >> __quoted_string{ __tmp,
'"',
'\\' })
544 __p = std::move(__tmp);
549 template<
typename _Source>
553 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 556 return path{ __source };
561 template<
typename _InputIterator>
563 u8path(_InputIterator __first, _InputIterator __last)
565 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 568 return path{ __first, __last };
575 filesystem_error(
const string& __what_arg,
error_code __ec)
578 filesystem_error(
const string& __what_arg,
const path& __p1,
582 filesystem_error(
const string& __what_arg,
const path& __p1,
584 :
system_error(__ec, __what_arg), _M_path1(__p1), _M_path2(__p2)
589 const path& path1() const noexcept {
return _M_path1; }
590 const path& path2() const noexcept {
return _M_path2; }
591 const char* what() const noexcept {
return _M_what.c_str(); }
603 {
using value_type = char; };
607 {
using value_type = wchar_t; };
611 {
using value_type = char16_t; };
615 {
using value_type = char32_t; };
617 template<
typename _Tp>
618 struct path::__is_encoded_char<const _Tp> : __is_encoded_char<_Tp> { };
620 struct path::_Cmpt : path
622 _Cmpt(string_type __s, _Type __t,
size_t __pos)
623 : path(
std::move(__s), __t), _M_pos(__pos) { }
625 _Cmpt() : _M_pos(-1) { }
632 struct path::_Cvt<path::value_type>
634 template<
typename _Iter>
636 _S_convert(_Iter __first, _Iter __last)
637 {
return string_type{__first, __last}; }
640 template<
typename _CharT>
643 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 645 _S_wconvert(
const char* __f,
const char* __l,
true_type)
648 const auto& __cvt = std::use_facet<_Cvt>(
std::locale{});
650 if (__str_codecvt_in(__f, __l, __wstr, __cvt))
652 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
653 "Cannot convert character sequence",
654 std::make_error_code(errc::illegal_byte_sequence)));
658 _S_wconvert(
const _CharT* __f,
const _CharT* __l,
false_type)
660 std::codecvt_utf8<_CharT> __cvt;
662 if (__str_codecvt_out(__f, __l, __str, __cvt))
664 const char* __f2 = __str.
data();
665 const char* __l2 = __f2 + __str.
size();
666 std::codecvt_utf8<wchar_t> __wcvt;
668 if (__str_codecvt_in(__f2, __l2, __wstr, __wcvt))
671 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
672 "Cannot convert character sequence",
673 std::make_error_code(errc::illegal_byte_sequence)));
677 _S_convert(
const _CharT* __f,
const _CharT* __l)
679 return _S_wconvert(__f, __l, is_same<_CharT, char>{});
683 _S_convert(
const _CharT* __f,
const _CharT* __l)
685 std::codecvt_utf8<_CharT> __cvt;
687 if (__str_codecvt_out(__f, __l, __str, __cvt))
689 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
690 "Cannot convert character sequence",
691 std::make_error_code(errc::illegal_byte_sequence)));
696 _S_convert(_CharT* __f, _CharT* __l)
698 return _S_convert(const_cast<const _CharT*>(__f),
699 const_cast<const _CharT*>(__l));
702 template<
typename _Iter>
704 _S_convert(_Iter __first, _Iter __last)
707 return _S_convert(__str.
data(), __str.
data() + __str.
size());
710 template<
typename _Iter,
typename _Cont>
712 _S_convert(__gnu_cxx::__normal_iterator<_Iter, _Cont> __first,
713 __gnu_cxx::__normal_iterator<_Iter, _Cont> __last)
714 {
return _S_convert(__first.base(), __last.base()); }
721 using difference_type = std::ptrdiff_t;
727 iterator() : _M_path(
nullptr), _M_cur(), _M_at_end() { }
736 iterator operator++(
int) {
auto __tmp = *
this; ++*
this;
return __tmp; }
739 iterator operator--(
int) {
auto __tmp = *
this; --*
this;
return __tmp; }
742 {
return __lhs._M_equals(__rhs); }
745 {
return !__lhs._M_equals(__rhs); }
750 iterator(
const path* __path, path::_List::const_iterator __iter)
751 : _M_path(__path), _M_cur(__iter), _M_at_end()
755 : _M_path(__path), _M_cur(), _M_at_end(__at_end)
761 path::_List::const_iterator _M_cur;
767 path::operator=(
path&& __p) noexcept
769 _M_pathname = std::move(__p._M_pathname);
770 _M_cmpts = std::move(__p._M_cmpts);
771 _M_type = __p._M_type;
777 path::operator=(string_type&& __source)
778 {
return *
this =
path(std::move(__source)); }
781 path::assign(string_type&& __source)
782 {
return *
this = path(std::move(__source)); }
785 path::operator+=(
const path& __p)
787 return operator+=(__p.native());
791 path::operator+=(
const string_type& __x)
799 path::operator+=(
const value_type* __x)
807 path::operator+=(value_type __x)
814 #if __cplusplus >= 201402L 816 path::operator+=(basic_string_view<value_type> __x)
818 _M_pathname.
append(__x.data(), __x.size());
824 template<
typename _CharT>
825 inline path::_Path<_CharT*, _CharT*>&
826 path::operator+=(_CharT __x)
829 return concat(__addr, __addr + 1);
833 path::make_preferred()
835 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 837 preferred_separator);
842 inline void path::swap(path& __rhs) noexcept
844 _M_pathname.swap(__rhs._M_pathname);
845 _M_cmpts.swap(__rhs._M_cmpts);
846 std::swap(_M_type, __rhs._M_type);
849 template<
typename _CharT,
typename _Traits,
typename _Allocator>
853 if (is_same<_CharT, value_type>::value)
854 return { _M_pathname.
begin(), _M_pathname.
end(), __a };
856 const value_type* __first = _M_pathname.
data();
857 const value_type* __last = __first + _M_pathname.
size();
859 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 860 using _CharAlloc = __alloc_rebind<_Allocator, char>;
861 using _String = basic_string<char, char_traits<char>, _CharAlloc>;
862 using _WString = basic_string<_CharT, _Traits, _Allocator>;
865 codecvt_utf8<value_type> __cvt;
866 _String __u8str{_CharAlloc{__a}};
867 if (__str_codecvt_out(__first, __last, __u8str, __cvt))
872 operator()(
const _String& __from, _String&,
true_type)
876 operator()(
const _String& __from, _WString& __to,
false_type)
879 codecvt_utf8<_CharT> __cvt;
880 const char* __f = __from.data();
881 const char* __l = __f + __from.size();
882 if (__str_codecvt_in(__f, __l, __to, __cvt))
888 if (
auto* __p = __dispatch(__u8str, __wstr, is_same<_CharT, char>{}))
892 codecvt_utf8<_CharT> __cvt;
893 basic_string<_CharT, _Traits, _Allocator> __wstr{__a};
894 if (__str_codecvt_in(__first, __last, __wstr, __cvt))
897 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
898 "Cannot convert character sequence",
899 std::make_error_code(errc::illegal_byte_sequence)));
905 #if _GLIBCXX_USE_WCHAR_T 911 path::u8string()
const 913 #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS 916 codecvt_utf8<value_type> __cvt;
917 const value_type* __first = _M_pathname.
data();
918 const value_type* __last = __first + _M_pathname.
size();
919 if (__str_codecvt_out(__first, __last, __str, __cvt))
921 _GLIBCXX_THROW_OR_ABORT(filesystem_error(
922 "Cannot convert character sequence",
923 std::make_error_code(errc::illegal_byte_sequence)));
935 #ifndef _GLIBCXX_FILESYSTEM_IS_WINDOWS 936 template<
typename _CharT,
typename _Traits,
typename _Allocator>
938 path::generic_string(
const _Allocator& __a)
const 939 {
return string<_CharT, _Traits, _Allocator>(__a); }
942 path::generic_string()
const {
return string(); }
944 #if _GLIBCXX_USE_WCHAR_T 946 path::generic_wstring()
const {
return wstring(); }
950 path::generic_u8string()
const {
return u8string(); }
953 path::generic_u16string()
const {
return u16string(); }
956 path::generic_u32string()
const {
return u32string(); }
960 path::compare(
const string_type& __s)
const {
return compare(path(__s)); }
963 path::compare(
const value_type* __s)
const {
return compare(path(__s)); }
965 #if __cplusplus >= 201402L 967 path::compare(basic_string_view<value_type> __s)
const 968 {
return compare(path(__s)); }
972 path::filename()
const {
return empty() ? path() : *--
end(); }
977 auto ext = _M_find_extension();
978 if (ext.first && ext.second != 0)
979 return path{ext.first->substr(0, ext.second)};
984 path::extension()
const 986 auto ext = _M_find_extension();
988 return path{ext.first->substr(ext.second)};
993 path::has_stem()
const 995 auto ext = _M_find_extension();
996 return ext.first && ext.second != 0;
1000 path::has_extension()
const 1002 auto ext = _M_find_extension();
1006 inline path::iterator
1009 if (_M_type == _Type::_Multi)
1010 return iterator(
this, _M_cmpts.
begin());
1011 return iterator(
this,
false);
1014 inline path::iterator
1017 if (_M_type == _Type::_Multi)
1018 return iterator(
this, _M_cmpts.
end());
1019 return iterator(
this,
true);
1022 inline path::iterator&
1023 path::iterator::operator++()
1025 __glibcxx_assert(_M_path !=
nullptr);
1026 if (_M_path->_M_type == _Type::_Multi)
1028 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.
end());
1033 __glibcxx_assert(!_M_at_end);
1039 inline path::iterator&
1040 path::iterator::operator--()
1042 __glibcxx_assert(_M_path !=
nullptr);
1043 if (_M_path->_M_type == _Type::_Multi)
1045 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.begin());
1050 __glibcxx_assert(_M_at_end);
1056 inline path::iterator::reference
1057 path::iterator::operator*()
const 1059 __glibcxx_assert(_M_path !=
nullptr);
1060 if (_M_path->_M_type == _Type::_Multi)
1062 __glibcxx_assert(_M_cur != _M_path->_M_cmpts.end());
1069 path::iterator::_M_equals(iterator __rhs)
const 1071 if (_M_path != __rhs._M_path)
1073 if (_M_path ==
nullptr)
1075 if (_M_path->_M_type == path::_Type::_Multi)
1076 return _M_cur == __rhs._M_cur;
1077 return _M_at_end == __rhs._M_at_end;
1081 _GLIBCXX_END_NAMESPACE_CXX11
1086 _GLIBCXX_END_NAMESPACE_VERSION
1091 #endif // _GLIBCXX_EXPERIMENTAL_FS_PATH_H Class codecvt<wchar_t, char, mbstate_t> specialization.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
Thrown to indicate error code of underlying system.
Struct holding two objects of arbitrary type.
Bidirectional iterators support a superset of forward iterator operations.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
complex< _Tp > operator/(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x divided by y.
Managing sequences of characters and character-like objects.
Struct for delimited strings.
Define a member typedef type only if a boolean constant is true.
An iterator for the components of a path.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
Template class basic_istream.
basic_string< wchar_t > wstring
A string of wchar_t.
void push_back(_CharT __c)
Append a single character.
ISO C++ entities toplevel namespace is std.
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.
iterator begin() noexcept
const _CharT * c_str() const noexcept
Return const pointer to null-terminated contents.
Template class basic_ostream.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
static const size_type npos
Value returned by various member functions when they fail.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list.
basic_string & append(const basic_string &__str)
Append a string to this string.
basic_string< char32_t > u32string
A string of char32_t.
path u8path(const _Source &__source)
Compare paths.
basic_string< char16_t > u16string
A string of char16_t.
Container class for localization functionality.The locale class is first a class wrapper for C librar...
basic_string< char > string
A string of char.
size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
const _CharT * data() const noexcept
Return const pointer to contents.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
bool empty() const noexcept