zorba::base64::auto_attach#include <zorba/util/base64_stream.h> A base64::auto_attach is a class that attaches a base64::streambuf to a stream and automatically detaches it when the auto_attach object is destroyed.void f( ostream &os ) { base64::auto_attach<ostream> const raii( os ); // ... }A base64::auto_attach is useful for streams not created by you. Private Attributes
Public Functions
Private Attributesstream_StreamType * stream_
Public Functionsattachbool attach(StreamType &stream, char const *charset) Calls base64::attach() on the given stream.
Parameters
Returnstrue only if a base64::streambuf was attached.auto_attach auto_attach() Default constructor; does nothing.
auto_attach auto_attach(StreamType &stream) Constructs an auto_attach object calling attach() on the given stream.
Parameters
auto_attach auto_attach(auto_attach &from) Copy constructor that takes ownership of the stream.
Parameters
operator=auto_attach & operator=(auto_attach &from) Assignment operator that takes ownership of the stream.
Parameters
Returns*this.~auto_attach ~auto_attach() Destroys this auto_attach object calling detach() on the previously attached stream, if any.
|