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)
43 _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}
73 template<
typename _CharT,
typename _Traits>
75 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
79 __ostr << __str._M_delim;
80 for (
const _CharT* __c = __str._M_string; *__c; ++__c)
82 if (*__c == __str._M_delim || *__c == __str._M_escape)
83 __ostr << __str._M_escape;
86 __ostr << __str._M_delim;
88 return __os << __ostr.
str();
97 template<
typename _CharT,
typename _Traits,
typename _String>
99 operator<<(std::basic_ostream<_CharT, _Traits>& __os,
103 __ostr << __str._M_delim;
104 for (
auto& __c : __str._M_string)
106 if (__c == __str._M_delim || __c == __str._M_escape)
107 __ostr << __str._M_escape;
110 __ostr << __str._M_delim;
112 return __os << __ostr.
str();
119 template<
typename _CharT,
typename _Traits,
typename _Alloc>
129 if (__c != __str._M_delim)
132 __is >> __str._M_string;
135 __str._M_string.
clear();
136 std::ios_base::fmtflags __flags
143 if (__c == __str._M_escape)
149 else if (__c == __str._M_delim)
151 __str._M_string += __c;
159 _GLIBCXX_END_NAMESPACE_VERSION
Struct for delimited strings.
fmtflags flags() const
Access to format flags.
Managing sequences of characters and character-like objects.
Template class basic_ostream.
__istream_type & unget()
Unextracting the previous character.
ios_base & skipws(ios_base &__base)
Calls base.setf(ios_base::skipws).
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, const _Quoted_string< basic_string< _CharT, _Traits, _Alloc > &, _CharT > &__str)
Extractor for delimited strings. The left and right delimiters can be different.
void clear(iostate __state=goodbit)
[Re]sets the error state.
__string_type str() const
Copying out the string buffer.
Controlling output for std::string.
Template class basic_istream.
fmtflags setf(fmtflags __fmtfl)
Setting new format flags.
ISO C++ entities toplevel namespace is std.
bool good() const
Fast error checking.