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>
67 operator<<(std::basic_ostream<_CharT2, _Traits>& __os,
70 template<
typename _CharT2,
typename _Traits,
typename _String2>
72 operator<<(std::basic_ostream<_CharT2, _Traits>& __os,
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>
101 operator<<(std::basic_ostream<_CharT2, _Traits2>& __os,
115 template<
typename _CharT,
typename _Traits>
117 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
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>
142 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
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
void clear(iostate __state=goodbit)
[Re]sets the error state.
__string_type str() const
Copying out the string buffer.
bool good() const
Fast error checking.
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
fmtflags flags() const
Access to format flags.
ios_base & skipws(ios_base &__base)
Calls base.setf(ios_base::skipws).
Template class basic_ostream.
ISO C++ entities toplevel namespace is std.
A non-owning reference to a string.
Struct for delimited strings.
__istream_type & unget()
Unextracting the previous character.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
Template class basic_istream.
Controlling output for std::string.
Managing sequences of characters and character-like objects.