#include <HttpBody.h>

Collaboration diagram for HttpBody:

Public Member Functions

 HttpBody ()
 
void set (const SBuf &newContent)
 
void packInto (Packable *) const
 
void clear ()
 clear the HttpBody content More...
 
bool hasContent () const
 
size_t contentSize () const
 
const char * content () const
 

Private Member Functions

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

Private Attributes

SBuf raw_
 

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 21 of file HttpBody.h.

Constructor & Destructor Documentation

◆ HttpBody() [1/2]

HttpBody::HttpBody ( )
inline

Definition at line 24 of file HttpBody.h.

◆ HttpBody() [2/2]

HttpBody::HttpBody ( const HttpBody )
private

Member Function Documentation

◆ clear()

void HttpBody::clear ( )
inline

Definition at line 35 of file HttpBody.h.

References SBuf::clear(), and raw_.

Referenced by HttpReply::clean().

◆ content()

const char * HttpBody::content ( ) const
inline
Returns
body bytes (possibly not nil-terminated)

Definition at line 44 of file HttpBody.h.

References raw_, and SBuf::rawContent().

Referenced by ESIContext::fail(), packInto(), and CacheManager::start().

◆ contentSize()

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

Definition at line 41 of file HttpBody.h.

References SBuf::length(), and raw_.

Referenced by ESIContext::fail(), and packInto().

◆ hasContent()

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

Definition at line 38 of file HttpBody.h.

References SBuf::length(), and raw_.

Referenced by ESIContext::fail().

◆ operator=()

HttpBody & HttpBody::operator= ( const HttpBody )
private

◆ packInto()

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 14 of file HttpBody.cc.

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

Referenced by HttpReply::packInto().

◆ set()

void HttpBody::set ( const SBuf newContent)
inline

Definition at line 26 of file HttpBody.h.

References raw_.

Referenced by ErrorState::BuildHttpReply().

Member Data Documentation

◆ raw_

SBuf HttpBody::raw_
private

Definition at line 50 of file HttpBody.h.

Referenced by clear(), content(), contentSize(), hasContent(), and set().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors