Protocols::Http::IdentityContentLengthBodyWriter Class Reference

#include <IdentityContentLengthBodyWriter.h> [code]

Inherits Protocols::Http::BodyWriter.

Inheritance diagram for Protocols::Http::IdentityContentLengthBodyWriter:

Inheritance graph
[legend]
Collaboration diagram for Protocols::Http::IdentityContentLengthBodyWriter:

Collaboration graph
[legend]
List of all members.

Detailed Description

Writes HTTP message bodies of known length in the "identity" encoding.

Writes bytes to a Transport ensuring that a certain number of bytes has been written in total. After the last bytes is written, a BodyEnd() object may be passed in, but it is ignored and is not written which is not written to the Transport.

Protocol is supposed to create objects of this class if:

Definition at line 43 of file IdentityContentLengthBodyWriter.h.

Public Member Functions

 IdentityContentLengthBodyWriter (int contentLength)
 Constructs an IdentityContentLengthBodyWriter object.
 ~IdentityContentLengthBodyWriter ()
 Destructor.
bool write (const Data &, Transport *)
 Writes Data objects to bytes to transport if possible.

Private Attributes

int bytesLeft


Constructor & Destructor Documentation

IdentityContentLengthBodyWriter::IdentityContentLengthBodyWriter int  contentLength  ) 
 

Constructs an IdentityContentLengthBodyWriter object.

Definition at line 29 of file IdentityContentLengthBodyWriter.cpp.

IdentityContentLengthBodyWriter::~IdentityContentLengthBodyWriter  ) 
 

Destructor.

Definition at line 36 of file IdentityContentLengthBodyWriter.cpp.


Member Function Documentation

bool IdentityContentLengthBodyWriter::write const Data data,
Transport transport
[virtual]
 

Writes Data objects to bytes to transport if possible.

Parameters:
data is the Data object to write to transport.
transport is the Transport object to which to write data.
Returns:
true if the byte representation of data could be written to transport.

false otherwise.

The function write at most contentLength number of bytes in total (passed to the ctor). These bytes can be written in any number of chunks. After all chunks are written, a BodyEnd() object may be passed and it will just be ignored.

Implements Protocols::Http::BodyWriter.

Definition at line 54 of file IdentityContentLengthBodyWriter.cpp.


Member Data Documentation

int Protocols::Http::IdentityContentLengthBodyWriter::bytesLeft [private]
 

Definition at line 53 of file IdentityContentLengthBodyWriter.h.


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