Warning, /include/c++/v1/iomanip is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP_IOMANIP
0011 #define _LIBCPP_IOMANIP
0012
0013 /*
0014 iomanip synopsis
0015
0016 namespace std {
0017
0018 // types T1, T2, ... are unspecified implementation types
0019 T1 resetiosflags(ios_base::fmtflags mask);
0020 T2 setiosflags (ios_base::fmtflags mask);
0021 T3 setbase(int base);
0022 template<charT> T4 setfill(charT c);
0023 T5 setprecision(int n);
0024 T6 setw(int n);
0025 template <class moneyT> T7 get_money(moneyT& mon, bool intl = false);
0026 template <class charT, class moneyT> T8 put_money(const moneyT& mon, bool intl = false);
0027 template <class charT> T9 get_time(struct tm* tmb, const charT* fmt);
0028 template <class charT> T10 put_time(const struct tm* tmb, const charT* fmt);
0029
0030 template <class charT>
0031 T11 quoted(const charT* s, charT delim=charT('"'), charT escape=charT('\\')); // C++14
0032
0033 template <class charT, class traits, class Allocator>
0034 T12 quoted(const basic_string<charT, traits, Allocator>& s,
0035 charT delim=charT('"'), charT escape=charT('\\')); // C++14
0036
0037 template <class charT, class traits, class Allocator>
0038 T13 quoted(basic_string<charT, traits, Allocator>& s,
0039 charT delim=charT('"'), charT escape=charT('\\')); // C++14
0040
0041 } // std
0042
0043 */
0044
0045 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0046 # include <__cxx03/iomanip>
0047 #else
0048 # include <__config>
0049
0050 # if _LIBCPP_HAS_LOCALIZATION
0051
0052 # include <__ostream/put_character_sequence.h>
0053 # include <ios>
0054 # include <iosfwd>
0055 # include <locale>
0056 # include <version>
0057
0058 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0059 # pragma GCC system_header
0060 # endif
0061
0062 _LIBCPP_BEGIN_NAMESPACE_STD
0063
0064 // resetiosflags
0065
0066 class __iom_t1 {
0067 ios_base::fmtflags __mask_;
0068
0069 public:
0070 _LIBCPP_HIDE_FROM_ABI explicit __iom_t1(ios_base::fmtflags __m) : __mask_(__m) {}
0071
0072 template <class _CharT, class _Traits>
0073 friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0074 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t1& __x) {
0075 __is.unsetf(__x.__mask_);
0076 return __is;
0077 }
0078
0079 template <class _CharT, class _Traits>
0080 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0081 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t1& __x) {
0082 __os.unsetf(__x.__mask_);
0083 return __os;
0084 }
0085 };
0086
0087 inline _LIBCPP_HIDE_FROM_ABI __iom_t1 resetiosflags(ios_base::fmtflags __mask) { return __iom_t1(__mask); }
0088
0089 // setiosflags
0090
0091 class __iom_t2 {
0092 ios_base::fmtflags __mask_;
0093
0094 public:
0095 _LIBCPP_HIDE_FROM_ABI explicit __iom_t2(ios_base::fmtflags __m) : __mask_(__m) {}
0096
0097 template <class _CharT, class _Traits>
0098 friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0099 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t2& __x) {
0100 __is.setf(__x.__mask_);
0101 return __is;
0102 }
0103
0104 template <class _CharT, class _Traits>
0105 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0106 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t2& __x) {
0107 __os.setf(__x.__mask_);
0108 return __os;
0109 }
0110 };
0111
0112 inline _LIBCPP_HIDE_FROM_ABI __iom_t2 setiosflags(ios_base::fmtflags __mask) { return __iom_t2(__mask); }
0113
0114 // setbase
0115
0116 class __iom_t3 {
0117 int __base_;
0118
0119 public:
0120 _LIBCPP_HIDE_FROM_ABI explicit __iom_t3(int __b) : __base_(__b) {}
0121
0122 template <class _CharT, class _Traits>
0123 friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0124 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t3& __x) {
0125 __is.setf(__x.__base_ == 8 ? ios_base::oct
0126 : __x.__base_ == 10 ? ios_base::dec
0127 : __x.__base_ == 16 ? ios_base::hex
0128 : ios_base::fmtflags(0),
0129 ios_base::basefield);
0130 return __is;
0131 }
0132
0133 template <class _CharT, class _Traits>
0134 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0135 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t3& __x) {
0136 __os.setf(__x.__base_ == 8 ? ios_base::oct
0137 : __x.__base_ == 10 ? ios_base::dec
0138 : __x.__base_ == 16 ? ios_base::hex
0139 : ios_base::fmtflags(0),
0140 ios_base::basefield);
0141 return __os;
0142 }
0143 };
0144
0145 inline _LIBCPP_HIDE_FROM_ABI __iom_t3 setbase(int __base) { return __iom_t3(__base); }
0146
0147 // setfill
0148
0149 template <class _CharT>
0150 class __iom_t4 {
0151 _CharT __fill_;
0152
0153 public:
0154 _LIBCPP_HIDE_FROM_ABI explicit __iom_t4(_CharT __c) : __fill_(__c) {}
0155
0156 template <class _Traits>
0157 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0158 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t4& __x) {
0159 __os.fill(__x.__fill_);
0160 return __os;
0161 }
0162 };
0163
0164 template <class _CharT>
0165 inline _LIBCPP_HIDE_FROM_ABI __iom_t4<_CharT> setfill(_CharT __c) {
0166 return __iom_t4<_CharT>(__c);
0167 }
0168
0169 // setprecision
0170
0171 class __iom_t5 {
0172 int __n_;
0173
0174 public:
0175 _LIBCPP_HIDE_FROM_ABI explicit __iom_t5(int __n) : __n_(__n) {}
0176
0177 template <class _CharT, class _Traits>
0178 friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0179 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t5& __x) {
0180 __is.precision(__x.__n_);
0181 return __is;
0182 }
0183
0184 template <class _CharT, class _Traits>
0185 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0186 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t5& __x) {
0187 __os.precision(__x.__n_);
0188 return __os;
0189 }
0190 };
0191
0192 inline _LIBCPP_HIDE_FROM_ABI __iom_t5 setprecision(int __n) { return __iom_t5(__n); }
0193
0194 // setw
0195
0196 class __iom_t6 {
0197 int __n_;
0198
0199 public:
0200 _LIBCPP_HIDE_FROM_ABI explicit __iom_t6(int __n) : __n_(__n) {}
0201
0202 template <class _CharT, class _Traits>
0203 friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0204 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t6& __x) {
0205 __is.width(__x.__n_);
0206 return __is;
0207 }
0208
0209 template <class _CharT, class _Traits>
0210 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0211 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t6& __x) {
0212 __os.width(__x.__n_);
0213 return __os;
0214 }
0215 };
0216
0217 inline _LIBCPP_HIDE_FROM_ABI __iom_t6 setw(int __n) { return __iom_t6(__n); }
0218
0219 // get_money
0220
0221 template <class _MoneyT>
0222 class __iom_t7;
0223
0224 template <class _CharT, class _Traits, class _MoneyT>
0225 _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0226 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x);
0227
0228 template <class _MoneyT>
0229 class __iom_t7 {
0230 _MoneyT& __mon_;
0231 bool __intl_;
0232
0233 public:
0234 _LIBCPP_HIDE_FROM_ABI __iom_t7(_MoneyT& __mon, bool __intl) : __mon_(__mon), __intl_(__intl) {}
0235
0236 template <class _CharT, class _Traits, class _Mp>
0237 friend basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_Mp>& __x);
0238 };
0239
0240 template <class _CharT, class _Traits, class _MoneyT>
0241 _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0242 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x) {
0243 # if _LIBCPP_HAS_EXCEPTIONS
0244 try {
0245 # endif // _LIBCPP_HAS_EXCEPTIONS
0246 typename basic_istream<_CharT, _Traits>::sentry __s(__is);
0247 if (__s) {
0248 typedef istreambuf_iterator<_CharT, _Traits> _Ip;
0249 typedef money_get<_CharT, _Ip> _Fp;
0250 ios_base::iostate __err = ios_base::goodbit;
0251 const _Fp& __mf = std::use_facet<_Fp>(__is.getloc());
0252 __mf.get(_Ip(__is), _Ip(), __x.__intl_, __is, __err, __x.__mon_);
0253 __is.setstate(__err);
0254 }
0255 # if _LIBCPP_HAS_EXCEPTIONS
0256 } catch (...) {
0257 __is.__set_badbit_and_consider_rethrow();
0258 }
0259 # endif // _LIBCPP_HAS_EXCEPTIONS
0260 return __is;
0261 }
0262
0263 template <class _MoneyT>
0264 inline _LIBCPP_HIDE_FROM_ABI __iom_t7<_MoneyT> get_money(_MoneyT& __mon, bool __intl = false) {
0265 return __iom_t7<_MoneyT>(__mon, __intl);
0266 }
0267
0268 // put_money
0269
0270 template <class _MoneyT>
0271 class __iom_t8;
0272
0273 template <class _CharT, class _Traits, class _MoneyT>
0274 _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0275 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x);
0276
0277 template <class _MoneyT>
0278 class __iom_t8 {
0279 const _MoneyT& __mon_;
0280 bool __intl_;
0281
0282 public:
0283 _LIBCPP_HIDE_FROM_ABI __iom_t8(const _MoneyT& __mon, bool __intl) : __mon_(__mon), __intl_(__intl) {}
0284
0285 template <class _CharT, class _Traits, class _Mp>
0286 friend basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_Mp>& __x);
0287 };
0288
0289 template <class _CharT, class _Traits, class _MoneyT>
0290 _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0291 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x) {
0292 # if _LIBCPP_HAS_EXCEPTIONS
0293 try {
0294 # endif // _LIBCPP_HAS_EXCEPTIONS
0295 typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
0296 if (__s) {
0297 typedef ostreambuf_iterator<_CharT, _Traits> _Op;
0298 typedef money_put<_CharT, _Op> _Fp;
0299 const _Fp& __mf = std::use_facet<_Fp>(__os.getloc());
0300 if (__mf.put(_Op(__os), __x.__intl_, __os, __os.fill(), __x.__mon_).failed())
0301 __os.setstate(ios_base::badbit);
0302 }
0303 # if _LIBCPP_HAS_EXCEPTIONS
0304 } catch (...) {
0305 __os.__set_badbit_and_consider_rethrow();
0306 }
0307 # endif // _LIBCPP_HAS_EXCEPTIONS
0308 return __os;
0309 }
0310
0311 template <class _MoneyT>
0312 inline _LIBCPP_HIDE_FROM_ABI __iom_t8<_MoneyT> put_money(const _MoneyT& __mon, bool __intl = false) {
0313 return __iom_t8<_MoneyT>(__mon, __intl);
0314 }
0315
0316 // get_time
0317
0318 template <class _CharT>
0319 class __iom_t9;
0320
0321 template <class _CharT, class _Traits>
0322 _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0323 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x);
0324
0325 template <class _CharT>
0326 class __iom_t9 {
0327 tm* __tm_;
0328 const _CharT* __fmt_;
0329
0330 public:
0331 _LIBCPP_HIDE_FROM_ABI __iom_t9(tm* __tm, const _CharT* __fmt) : __tm_(__tm), __fmt_(__fmt) {}
0332
0333 template <class _Cp, class _Traits>
0334 friend basic_istream<_Cp, _Traits>& operator>>(basic_istream<_Cp, _Traits>& __is, const __iom_t9<_Cp>& __x);
0335 };
0336
0337 template <class _CharT, class _Traits>
0338 _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0339 operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x) {
0340 # if _LIBCPP_HAS_EXCEPTIONS
0341 try {
0342 # endif // _LIBCPP_HAS_EXCEPTIONS
0343 typename basic_istream<_CharT, _Traits>::sentry __s(__is);
0344 if (__s) {
0345 typedef istreambuf_iterator<_CharT, _Traits> _Ip;
0346 typedef time_get<_CharT, _Ip> _Fp;
0347 ios_base::iostate __err = ios_base::goodbit;
0348 const _Fp& __tf = std::use_facet<_Fp>(__is.getloc());
0349 __tf.get(_Ip(__is), _Ip(), __is, __err, __x.__tm_, __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_));
0350 __is.setstate(__err);
0351 }
0352 # if _LIBCPP_HAS_EXCEPTIONS
0353 } catch (...) {
0354 __is.__set_badbit_and_consider_rethrow();
0355 }
0356 # endif // _LIBCPP_HAS_EXCEPTIONS
0357 return __is;
0358 }
0359
0360 template <class _CharT>
0361 inline _LIBCPP_HIDE_FROM_ABI __iom_t9<_CharT> get_time(tm* __tm, const _CharT* __fmt) {
0362 return __iom_t9<_CharT>(__tm, __fmt);
0363 }
0364
0365 // put_time
0366
0367 template <class _CharT>
0368 class __iom_t10;
0369
0370 template <class _CharT, class _Traits>
0371 _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0372 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x);
0373
0374 template <class _CharT>
0375 class __iom_t10 {
0376 const tm* __tm_;
0377 const _CharT* __fmt_;
0378
0379 public:
0380 _LIBCPP_HIDE_FROM_ABI __iom_t10(const tm* __tm, const _CharT* __fmt) : __tm_(__tm), __fmt_(__fmt) {}
0381
0382 template <class _Cp, class _Traits>
0383 friend basic_ostream<_Cp, _Traits>& operator<<(basic_ostream<_Cp, _Traits>& __os, const __iom_t10<_Cp>& __x);
0384 };
0385
0386 template <class _CharT, class _Traits>
0387 _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0388 operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x) {
0389 # if _LIBCPP_HAS_EXCEPTIONS
0390 try {
0391 # endif // _LIBCPP_HAS_EXCEPTIONS
0392 typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
0393 if (__s) {
0394 typedef ostreambuf_iterator<_CharT, _Traits> _Op;
0395 typedef time_put<_CharT, _Op> _Fp;
0396 const _Fp& __tf = std::use_facet<_Fp>(__os.getloc());
0397 if (__tf.put(_Op(__os), __os, __os.fill(), __x.__tm_, __x.__fmt_, __x.__fmt_ + _Traits::length(__x.__fmt_))
0398 .failed())
0399 __os.setstate(ios_base::badbit);
0400 }
0401 # if _LIBCPP_HAS_EXCEPTIONS
0402 } catch (...) {
0403 __os.__set_badbit_and_consider_rethrow();
0404 }
0405 # endif // _LIBCPP_HAS_EXCEPTIONS
0406 return __os;
0407 }
0408
0409 template <class _CharT>
0410 inline _LIBCPP_HIDE_FROM_ABI __iom_t10<_CharT> put_time(const tm* __tm, const _CharT* __fmt) {
0411 return __iom_t10<_CharT>(__tm, __fmt);
0412 }
0413
0414 template <class _CharT, class _Traits>
0415 _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& __quoted_output(
0416 basic_ostream<_CharT, _Traits>& __os,
0417 const _CharT* __first,
0418 const _CharT* __last,
0419 _CharT __delim,
0420 _CharT __escape) {
0421 basic_string<_CharT, _Traits> __str;
0422 __str.push_back(__delim);
0423 for (; __first != __last; ++__first) {
0424 if (_Traits::eq(*__first, __escape) || _Traits::eq(*__first, __delim))
0425 __str.push_back(__escape);
0426 __str.push_back(*__first);
0427 }
0428 __str.push_back(__delim);
0429 return std::__put_character_sequence(__os, __str.data(), __str.size());
0430 }
0431
0432 template <class _CharT, class _Traits, class _String>
0433 _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0434 __quoted_input(basic_istream<_CharT, _Traits>& __is, _String& __string, _CharT __delim, _CharT __escape) {
0435 __string.clear();
0436 _CharT __c;
0437 __is >> __c;
0438 if (__is.fail())
0439 return __is;
0440
0441 if (!_Traits::eq(__c, __delim)) {
0442 // no delimiter, read the whole string
0443 __is.unget();
0444 __is >> __string;
0445 return __is;
0446 }
0447
0448 __save_flags<_CharT, _Traits> __sf(__is);
0449 std::noskipws(__is);
0450 while (true) {
0451 __is >> __c;
0452 if (__is.fail())
0453 break;
0454 if (_Traits::eq(__c, __escape)) {
0455 __is >> __c;
0456 if (__is.fail())
0457 break;
0458 } else if (_Traits::eq(__c, __delim))
0459 break;
0460 __string.push_back(__c);
0461 }
0462 return __is;
0463 }
0464
0465 template <class _CharT, class _Traits>
0466 struct _LIBCPP_HIDDEN __quoted_output_proxy {
0467 const _CharT* __first_;
0468 const _CharT* __last_;
0469 _CharT __delim_;
0470 _CharT __escape_;
0471
0472 _LIBCPP_HIDE_FROM_ABI explicit __quoted_output_proxy(const _CharT* __f, const _CharT* __l, _CharT __d, _CharT __e)
0473 : __first_(__f), __last_(__l), __delim_(__d), __escape_(__e) {}
0474
0475 template <class _T2, __enable_if_t<_IsSame<_Traits, void>::value || _IsSame<_Traits, _T2>::value, int> = 0>
0476 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _T2>&
0477 operator<<(basic_ostream<_CharT, _T2>& __os, const __quoted_output_proxy& __p) {
0478 return std::__quoted_output(__os, __p.__first_, __p.__last_, __p.__delim_, __p.__escape_);
0479 }
0480 };
0481
0482 template <class _CharT, class _Traits, class _Allocator>
0483 struct _LIBCPP_HIDDEN __quoted_proxy {
0484 basic_string<_CharT, _Traits, _Allocator>& __string_;
0485 _CharT __delim_;
0486 _CharT __escape_;
0487
0488 _LIBCPP_HIDE_FROM_ABI explicit __quoted_proxy(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __d, _CharT __e)
0489 : __string_(__s), __delim_(__d), __escape_(__e) {}
0490
0491 friend _LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
0492 operator<<(basic_ostream<_CharT, _Traits>& __os, const __quoted_proxy& __p) {
0493 return std::__quoted_output(
0494 __os, __p.__string_.data(), __p.__string_.data() + __p.__string_.size(), __p.__delim_, __p.__escape_);
0495 }
0496
0497 friend _LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>&
0498 operator>>(basic_istream<_CharT, _Traits>& __is, const __quoted_proxy& __p) {
0499 return std::__quoted_input(__is, __p.__string_, __p.__delim_, __p.__escape_);
0500 }
0501 };
0502
0503 template <class _CharT, class _Traits, class _Allocator>
0504 _LIBCPP_HIDE_FROM_ABI __quoted_output_proxy<_CharT, _Traits>
0505 __quoted(const basic_string<_CharT, _Traits, _Allocator>& __s,
0506 _CharT __delim = _CharT('"'),
0507 _CharT __escape = _CharT('\\')) {
0508 return __quoted_output_proxy<_CharT, _Traits>(__s.data(), __s.data() + __s.size(), __delim, __escape);
0509 }
0510
0511 template <class _CharT, class _Traits, class _Allocator>
0512 _LIBCPP_HIDE_FROM_ABI __quoted_proxy<_CharT, _Traits, _Allocator>
0513 __quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
0514 return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
0515 }
0516
0517 # if _LIBCPP_STD_VER >= 14
0518
0519 template <class _CharT>
0520 _LIBCPP_HIDE_FROM_ABI auto quoted(const _CharT* __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
0521 const _CharT* __end = __s;
0522 while (*__end)
0523 ++__end;
0524 return __quoted_output_proxy<_CharT, void>(__s, __end, __delim, __escape);
0525 }
0526
0527 template <class _CharT, class _Traits, class _Allocator>
0528 _LIBCPP_HIDE_FROM_ABI auto
0529 quoted(const basic_string<_CharT, _Traits, _Allocator>& __s,
0530 _CharT __delim = _CharT('"'),
0531 _CharT __escape = _CharT('\\')) {
0532 return __quoted_output_proxy<_CharT, _Traits>(__s.data(), __s.data() + __s.size(), __delim, __escape);
0533 }
0534
0535 template <class _CharT, class _Traits, class _Allocator>
0536 _LIBCPP_HIDE_FROM_ABI auto
0537 quoted(basic_string<_CharT, _Traits, _Allocator>& __s, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
0538 return __quoted_proxy<_CharT, _Traits, _Allocator>(__s, __delim, __escape);
0539 }
0540
0541 template <class _CharT, class _Traits>
0542 _LIBCPP_HIDE_FROM_ABI auto
0543 quoted(basic_string_view<_CharT, _Traits> __sv, _CharT __delim = _CharT('"'), _CharT __escape = _CharT('\\')) {
0544 return __quoted_output_proxy<_CharT, _Traits>(__sv.data(), __sv.data() + __sv.size(), __delim, __escape);
0545 }
0546
0547 # endif // _LIBCPP_STD_VER >= 14
0548
0549 _LIBCPP_END_NAMESPACE_STD
0550
0551 # endif // _LIBCPP_HAS_LOCALIZATION
0552
0553 # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0554 # include <array>
0555 # include <bitset>
0556 # include <deque>
0557 # include <format>
0558 # include <functional>
0559 # include <istream>
0560 # include <ostream>
0561 # include <print>
0562 # include <queue>
0563 # include <stack>
0564 # include <unordered_map>
0565 # include <vector>
0566 # endif
0567 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0568
0569 #endif // _LIBCPP_IOMANIP