libfossil
fsl::FslOutputFStream Class Reference

This std::ostream subclass which proxies a fsl_output_f() implementation, sending all output to that function. More...

#include "fossil.hpp"

Inheritance diagram for fsl::FslOutputFStream:
fsl::BufferOStream

Public Member Functions

 FslOutputFStream (fsl_output_f out, void *outState)
 Sets up this stream to direct all stream output sent to this buffer to out(outState, ...) instead. More...
 
virtual ~FslOutputFStream () throw ()
 Cleans up its internal resources. More...
 
FslOutputFStreamappendf (char const *fmt,...)
 Appends a formatted string, as per fsl_outputf(), to the stream. More...
 

Detailed Description

This std::ostream subclass which proxies a fsl_output_f() implementation, sending all output to that function.

The stream throws on output errors.

Example usage, sending output to a Buffer using stream operators:

Buffer buf;
// ^^^ For this particular case MAKE SURE to pass the C
// fsl_buffer handle, NOT the C++ Buffer handle!
os << "hi, world!";
assert(10==buf.used());
// Or, more simply:
BufferOStream bos(buf);
bos << "hi, world!";

Definition at line 2182 of file fossil.hpp.

Constructor & Destructor Documentation

fsl::FslOutputFStream::FslOutputFStream ( fsl_output_f  out,
void *  outState 
)
explicit

Sets up this stream to direct all stream output sent to this buffer to out(outState, ...) instead.

Ownership of outState is not changed. outState, if not NULL, must outlive this object.

Throws if !out.

virtual fsl::FslOutputFStream::~FslOutputFStream ( )
throw (
)
virtual

Cleans up its internal resources.

Member Function Documentation

FslOutputFStream& fsl::FslOutputFStream::appendf ( char const *  fmt,
  ... 
)

Appends a formatted string, as per fsl_outputf(), to the stream.

This is primarily intended for adding SQL-related escaping to the buffer using the q/Q specifiers.

Returns this object.


The documentation for this class was generated from the following file: