30 #ifndef _GLIBCXX_QUOTED_STRING_H
31 #define _GLIBCXX_QUOTED_STRING_H 1
33 #pragma GCC system_header
35 #if __cplusplus < 201103L
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
48 template<
typename _String,
typename _CharT>
53 "String type must be pointer or reference");
56 : _M_string(__str), _M_delim{__del}, _M_escape{__esc}
67 #if __cplusplus >= 201703L
68 template<
typename _CharT,
typename _Traits>
72 _CharT __del, _CharT __esc)
73 : _M_string(__str), _M_delim{__del}, _M_escape{__esc}
77 operator=(_Quoted_string&) =
delete;
79 basic_string_view<_CharT, _Traits> _M_string;
90 template<
typename _CharT,
typename _Traits>
98 __ostr << __str._M_delim;
99 for (
const _CharT* __c = __str._M_string; *__c; ++__c)
101 if (*__c == __str._M_delim || *__c == __str._M_escape)
102 __ostr << __str._M_escape;
105 __ostr << __str._M_delim;
107 return __os << __ostr.
str();
115 template<
typename _CharT,
typename _Traits,
typename _String>
123 __ostr << __str._M_delim;
124 for (
auto __c : __str._M_string)
126 if (__c == __str._M_delim || __c == __str._M_escape)
127 __ostr << __str._M_escape;
130 __ostr << __str._M_delim;
132 return __os << __ostr.
str();
141 template<
typename _CharT,
typename _Traits,
typename _Alloc>
151 if (__c != __str._M_delim)
154 __is >> __str._M_string;
157 __str._M_string.clear();
158 std::ios_base::fmtflags __flags
165 if (__c == __str._M_escape)
171 else if (__c == __str._M_delim)
173 __str._M_string += __c;
182 _GLIBCXX_END_NAMESPACE_VERSION