30 #ifndef _GLIBCXX_QUOTED_STRING_H
31 #define _GLIBCXX_QUOTED_STRING_H 1
33 #ifdef _GLIBCXX_SYSHDR
34 #pragma GCC system_header
37 #if __cplusplus < 201103L
42 namespace std _GLIBCXX_VISIBILITY(default)
44 _GLIBCXX_BEGIN_NAMESPACE_VERSION
50 template<
typename _String,
typename _CharT>
55 "String type must be pointer or reference");
58 : _M_string(__str), _M_delim{__del}, _M_escape{__esc}
65 template<
typename _CharT2,
typename _Traits>
70 template<
typename _CharT2,
typename _Traits,
typename _String2>
75 template<
typename _CharT2,
typename _Traits,
typename _Alloc>
86 #if __cplusplus >= 201703L
87 template<
typename _CharT,
typename _Traits>
91 _CharT __del, _CharT __esc)
92 : _M_string(__str), _M_delim{__del}, _M_escape{__esc}
96 operator=(_Quoted_string&) =
delete;
99 template<
typename _CharT2,
typename _Traits2,
typename _String2>
102 const _Quoted_string<_String2, _CharT2>& __str);
104 basic_string_view<_CharT, _Traits> _M_string;
115 template<
typename _CharT,
typename _Traits>
123 __ostr << __str._M_delim;
124 for (
const _CharT* __c = __str._M_string; *__c; ++__c)
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();
140 template<
typename _CharT,
typename _Traits,
typename _String>
148 __ostr << __str._M_delim;
149 for (
auto __c : __str._M_string)
151 if (__c == __str._M_delim || __c == __str._M_escape)
152 __ostr << __str._M_escape;
155 __ostr << __str._M_delim;
157 return __os << __ostr.
str();
166 template<
typename _CharT,
typename _Traits,
typename _Alloc>
176 if (__c != __str._M_delim)
179 __is >> __str._M_string;
182 __str._M_string.clear();
183 std::ios_base::fmtflags __flags
190 if (__c == __str._M_escape)
196 else if (__c == __str._M_delim)
198 __str._M_string += __c;
207 _GLIBCXX_END_NAMESPACE_VERSION