From a6f0ee9b1988e3be41805b4915b980ffdfb8b3a6 Mon Sep 17 00:00:00 2001
From: Beman Dawes The Boost quoted string stream I/O manipulator places delimiters, defaulted
+ The Boost If the string contains the delimiter character, on output that character will
+be preceded by an escape character, as will the escape character itself:
-
@@ -43,7 +43,7 @@ std::cout << round_trip; // outputs: fooled
assert(original == round_trip); // assert will fire
-Quoted String
+
- Stream
- I/O Manipulator"Quoted"
+ I/O Manipulator
+ for Stringsquoted
stream I/O manipulator places delimiters, defaulted
to the double-quote ("
), around strings on output, and strips off
the delimiters on input. This ensures strings with embedded spaces round-trip as
desired. For example,
+
std::cout << quoted("'Jack & Jill'", '&', '\''); // outputs: '&'Jack && Jill&''
+Header <boost/io/quoted_manip.hpp> synopsis
namespace boost
{
@@ -113,7 +118,8 @@ type with an implementation supplied
operator>>
:
operator==
, then:skipws
flag.string.clear()
delim
character is reached, extract
+ delim
character is reached or
+ is.not_good()
, extract
characters from os
and append them to string
,
except that if an escape
is reached, ignore it and append the
next character to string
.Distributed under the Boost Software License, Version 1.0. See www.boost.org/LICENSE_1_0.txt
Revised -18 June 2010
+19 June 2010