|
Boost : |
Subject: Re: [boost] [RFC] string inserter/extractor "q u o t i n g"
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-17 16:44:28
On 6/17/2010 3:38 PM, Beman Dawes wrote:
> To speed the process, I'll just give a progress report rather than
> respond individually prior messages.
>
> * I like quote and unquote as the names. Source changed.
>
> * Since these functions are I/O manipulators, and only work in that
> context, I've renamed the header "quote_manip.hpp".
>
> * Likewise, the library that makes the most sense to add the header
> too is io. So the include path will be <boost/io/quote_manip.hpp>. IO
> is a small library, and targets exactly the same area of the standard
> library.
>
> * The code has been cleaned up and the templates more closely conform
> to standard library practice as regards template parameters.
>
> See https://svn.boost.org/svn/boost/branches/filesystem3/boost/io/quote_manip.hpp
>
> Comments?
I assume you mean for the insertion and extraction operators to take the
proxy by const reference. It shouldn't compile as-is.
I still see no reason for separate "quote" and "unquote" functions.
There could just be one, called "quote" (or I like "quoted" as in: read
in a quoted string, write out a quoted string). It returns an object
that has both insertion and extraction operators.
Const-correctness and the C-string variant can be handled by passing the
string type as a template parameter: quote_proxy<string &> vs.
quote_proxy<string const &> vs. quote_proxy<char const *>.
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk