fastcgi++
Classes | Public Member Functions | Private Attributes
Fastcgipp::Fcgistream< charT > Class Template Reference

Stream class for output of client data through FastCGI. More...

#include <fcgistream.hpp>

List of all members.

Classes

struct  Encoder

Public Member Functions

 Fcgistream ()
void set (Protocol::FullId id, Transceiver &transceiver, Protocol::RecordType type)
 Arguments passed directly to FcgistreamSink::set()
void flush ()
 Called to flush all buffers to the sink.
void dump (const char *data, size_t size)
 Dumps raw data directly into the FastCGI protocol.
void dump (std::basic_istream< char > &stream)
 Dumps an input stream directly into the FastCGI protocol.
void setEncoding (OutputEncoding x)
 Sets the output encoding for this stream.

Private Attributes

Encoderm_encoder
FcgistreamSinkm_sink

Detailed Description

template<typename charT>
class Fastcgipp::Fcgistream< charT >

Stream class for output of client data through FastCGI.

This class is derived from std::basic_ostream<charT, traits>. It acts just the same as any stream does with the added feature of the dump() function and the ability to set output encoding with the setEncoding() function and the Fastcgipp::encoding manipulator.

Template Parameters:
charTCharacter type (char or wchar_t)
traitsCharacter traits
See also:
OutputEncoding

Definition at line 197 of file fcgistream.hpp.


Constructor & Destructor Documentation

template<typename charT >
Fastcgipp::Fcgistream< charT >::Fcgistream ( )

Definition at line 201 of file fcgistream.cpp.


Member Function Documentation

template<typename charT>
void Fastcgipp::Fcgistream< charT >::dump ( const char *  data,
size_t  size 
)
inline

Dumps raw data directly into the FastCGI protocol.

This function exists as a mechanism to dump raw data out the stream bypassing the stream buffer or any code conversion mechanisms. If the user has any binary data to send, this is the function to do it with.

Parameters:
[in]dataPointer to first byte of data to send
[in]sizeSize in bytes of data to be sent

Definition at line 228 of file fcgistream.hpp.

References Fastcgipp::FcgistreamSink::dump(), Fastcgipp::Fcgistream< charT >::flush(), and Fastcgipp::Fcgistream< charT >::m_sink.

template<typename charT>
void Fastcgipp::Fcgistream< charT >::dump ( std::basic_istream< char > &  stream)
inline

Dumps an input stream directly into the FastCGI protocol.

This function exists as a mechanism to dump a raw input stream out this stream bypassing the stream buffer or any code conversion mechanisms. Typically this would be a filestream associated with an image or something. The stream is transmitted until an EOF.

Parameters:
[in]streamReference to input stream that should be transmitted.

Definition at line 237 of file fcgistream.hpp.

References Fastcgipp::FcgistreamSink::dump(), Fastcgipp::Fcgistream< charT >::flush(), and Fastcgipp::Fcgistream< charT >::m_sink.

template<typename charT>
void Fastcgipp::Fcgistream< charT >::flush ( )
inline

Called to flush all buffers to the sink.

Definition at line 217 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT >::dump().

template<typename charT>
void Fastcgipp::Fcgistream< charT >::set ( Protocol::FullId  id,
Transceiver transceiver,
Protocol::RecordType  type 
)
inline

Arguments passed directly to FcgistreamSink::set()

Definition at line 214 of file fcgistream.hpp.

References Fastcgipp::Fcgistream< charT >::m_sink, and Fastcgipp::FcgistreamSink::set().

template<typename charT>
void Fastcgipp::Fcgistream< charT >::setEncoding ( OutputEncoding  x)
inline

Sets the output encoding for this stream.

This can also be set with the Fastcgipp::encoding manipulator.

Parameters:
[in]xEncoding type to use
See also:
OutputEncoding

Definition at line 246 of file fcgistream.hpp.

References Fastcgipp::Fcgistream< charT >::m_encoder, and Fastcgipp::Fcgistream< charT >::Encoder::m_state.

Referenced by Fastcgipp::operator<<().


Member Data Documentation

template<typename charT>
Encoder& Fastcgipp::Fcgistream< charT >::m_encoder
private

Definition at line 207 of file fcgistream.hpp.

Referenced by Fastcgipp::Fcgistream< charT >::setEncoding().

template<typename charT>
FcgistreamSink& Fastcgipp::Fcgistream< charT >::m_sink
private

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