#include <HttpBody.h>
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 | |
HttpBody & | operator= (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]
|
inline |
Definition at line 24 of file HttpBody.h.
◆ HttpBody() [2/2]
|
private |
Member Function Documentation
◆ clear()
|
inline |
Definition at line 35 of file HttpBody.h.
References SBuf::clear(), and raw_.
Referenced by HttpReply::clean().
◆ content()
|
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()
|
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()
|
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=()
◆ 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()
|
inline |
Definition at line 26 of file HttpBody.h.
References raw_.
Referenced by ErrorState::BuildHttpReply().
Member Data Documentation
◆ 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:
- src/HttpBody.h
- src/HttpBody.cc