#include <HttpBody.h>

Collaboration diagram for HttpBody:

Public Member Functions

 HttpBody ()
 
 ~HttpBody ()
 
void setMb (MemBuf *)
 
void packInto (Packable *) const
 
void clear ()
 clear the HttpBody content More...
 
bool hasContent () const
 
mb_size_t contentSize () const
 
char * content () const
 

Private Member Functions

HttpBodyoperator= (const HttpBody &)
 
 HttpBody (const HttpBody &)
 

Private Attributes

MemBufmb
 

Detailed Description

Representation of a short predetermined message

This class is useful to represent short HTTP messages, whose contents are known in advance, e.g. error messages

Definition at line 19 of file HttpBody.h.

Constructor & Destructor Documentation

HttpBody::HttpBody ( )

Definition at line 15 of file HttpBody.cc.

HttpBody::~HttpBody ( )

Definition at line 18 of file HttpBody.cc.

References mb.

HttpBody::HttpBody ( const HttpBody )
private

Member Function Documentation

void HttpBody::clear ( )

Definition at line 24 of file HttpBody.cc.

References MemBuf::clean(), and mb.

Referenced by HttpReply::clean().

char* HttpBody::content ( ) const
inline
Returns
pointer to the storage of the HttpBody

Definition at line 47 of file HttpBody.h.

References MemBuf::content(), and mb.

Referenced by ESIContext::fail().

mb_size_t HttpBody::contentSize ( ) const
inline
Returns
size of the HttpBody's message content

Definition at line 44 of file HttpBody.h.

References MemBuf::contentSize(), and mb.

Referenced by ESIContext::fail().

bool HttpBody::hasContent ( ) const
inline
Returns
true if there is any content in the HttpBody

Definition at line 41 of file HttpBody.h.

References MemBuf::contentSize(), and mb.

Referenced by ESIContext::fail().

HttpBody& HttpBody::operator= ( const HttpBody )
private
void HttpBody::packInto ( Packable p) const

output the HttpBody contents into the supplied container

Note
content is not cleared by the output operation

Definition at line 42 of file HttpBody.cc.

References Packable::append(), assert, MemBuf::content(), MemBuf::contentSize(), and mb.

Referenced by HttpReply::packInto(), and StoreEntry::startWriting().

void HttpBody::setMb ( MemBuf mb_)

absorb the MemBuf, discarding anything currently stored

After this call the lifetime of the passed MemBuf is managed by the HttpBody.

Definition at line 31 of file HttpBody.cc.

References mb.

Referenced by ErrorState::BuildHttpReply().

Member Data Documentation

MemBuf* HttpBody::mb
private

Definition at line 51 of file HttpBody.h.

Referenced by clear(), content(), contentSize(), hasContent(), packInto(), setMb(), and ~HttpBody().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors