Boost logo

Boost :

Subject: Re: [boost] [iostreams]ANNOUNCE:indent_filtering_ostream.zip in vault
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-01-11 07:14:31


Hi,
----- Original Message -----
From: "Larry Evans" <cppljevans_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, January 09, 2010 5:26 PM
Subject: [boost] [iostreams]ANNOUNCE:indent_filtering_ostream.zip in vault

>
> The .zip file in subject is here:
>
> http://www.boostpro.com/vault/index.php?&directory=Input%20-%20Output
>
> It includes a boost/iostreams/filter/indent.hpp and
> boost/iostreams/utility/indent_filtering_ostream.hpp.
>
> The latter uses the former to allow indenting and undenting
> a stream.
>
> Is there any interest in installing this in the iostreams library?

Definitely.

On the example I see that the ++ and -- are not pairwised.
int main(void)
{
    boost::iostreams::indent_filtering_ostream<> mout(std::cout);
    mout<<"line1\n";
+ ++mout;
    mout<<"line1.1"<<std::endl;
+ ++mout;
    mout<<"line1.1.1"<<std::endl;
    test_conversion(mout);
- --mout;
    unsigned u=22;
    mout<<"line1.2:unsigned="<<u<<std::endl;
    float f=3.1416;
    mout<<"line1.3:float="<<f<<std::endl;
- --mout;
- --mout;
    mout<<"line2\n";
    return 0;
}

Shouldn't a scoped_indent class helps on this?
Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk