Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-11-24 14:38:17


Jeff Flinn wrote:
> Jonathan,
>
> Just to let you know the apply_if -> eval_if changes that I previously
> mentioned were sufficient in my case to utilize your library with boost
> 1.32.0.

I can confirm this, as I am using it myself. However, msvc-8.0 requires
inclusion of <ios> in the file
boost/io/detail/streambufs/linked_streambuf.hpp to fix an error at line 54.

> The library is used to 'wrap' MFC non-standard facilities for
> cut/copy/paste and drag/drop for use with Robert's serialization library. In
> this case I am not using many of the more advanced features of your library
> (yet).

I am playing around with the library. Here are a few thoughts:

[1] And is it possible to access Sink members from stream_facade, for
example:

    stream_facade< speech_reader > speech;
    speech.set_pitch( 50 );
    speech.set_voice( "LH Michelle" );
    speech << "This is the Lernout & Hauspie Michelle voice.\n"

[2] I would like to collapse:

    std::ofstream out( "encoded.txt" );
    boost::io::filtering_ostream os;
    os.push( ascii85_encoder());
    os.push( out );
    os << ...;

to:

    class ascii85_ofstream: public boost::io::filtering_ostream
    {
       std::ofstream out;
       public:
          ascii85_ofstream( const char * fn ): out( fn )
          {
             push( ascii85_encoder());
             push( out );
          }
    };

    ascii85_ofstream os( "encoded.txt" );
    os << ...;

but this results in a crash at the destructor (tested with msvc-8.0).

Maybe if filtering_ostream takes a bool denoting if it closes on the
destructor (default to true), so I could do:

    ascii85_ofstream::ascii85_ofstream( const char * fn ):
       filtering_ostream( false ),
       out( fn )
    {
       push( ascii85_encoder());
       push( out );
    }

    ascii85_ofstream::~ascii85_ofstream()
    {
       close();
    }

Regards,
Reece


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