Boost logo

Boost Users :

Subject: [Boost-users] [iostreams] Apply a filter temporarily - base64_encoder
From: Fernando Pelliccioni (fpelliccioni_at_[hidden])
Date: 2011-10-21 19:34:56


Is there any way to apply a filter temporarily ?

I want to do this...

   io::filtering_ostream out;
   out.push_back(file_sink("my_file.txt"));

   out << "Authentication: ";

   out.push_front ( base64_encoder() ); // pseudo-code... see
*push_front* instead of *push*

   out << make_ntlm_auth_from_system(); // this have to be base64
encoded

   out.pop_front(); // removes the base64_encoder

   out << "......"; // *NO* base64 encoded

I don't want to do this...

   io::filtering_ostream out;
   out.push(file_sink("my_file.txt"));

   out << "Authentication: ";

   out.pop();

   out.push(base64_encoder());
   out.push(file_sink("my_file.txt"));

   out << make_ntlm_auth_from_system();

   out.pop();
   out.pop();

   out.push(file_sink("my_file.txt"));

   out << "......";

The function make_ntlm_auth_from_system() creates an object that is
*OStreamable*.

Any other suggestions are welcome. :)

Thanks and regards,
Fernando.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net