dodo
0.0.1
A C++ library to create containerized Linux services
|
A HTTP response line. More...
#include <httpresponse.hpp>
Public Member Functions | |
HTTPResponseLine () | |
Default constructor. More... | |
HTTPResponseLine (const HTTPVersion &version, HTTPCode http_code) | |
Explicit consructor. More... | |
virtual std::string | asString () const |
Convert the HTTPResponseLine to a HTTP string. More... | |
HTTPCode | getHTTPCode () const |
The HTTP return code of the HTTPResponse. More... | |
const HTTPVersion & | getHTTPVersion () const |
The HTTPVersion of the response line. More... | |
virtual ParseResult | parse (VirtualReadBuffer &data) |
Read a complete HTTPFragment from a VirtualReadBuffer. More... | |
Private Attributes | |
HTTPCode | http_code_ |
The http_code. More... | |
HTTPVersion | version_ |
The HTTPVersion. More... | |
Additional Inherited Members | |
![]() | |
enum | ParseError : unsigned int { peOk = 0, peIncomplete, peSystemError, peExpectCRLF, peUnFinishedToken, peExpectingHeaderColon, peInvalidHeaderFieldValue, peInvalidHeaderListEnd, peInvalidMethod, peInvalidHTTPVersion, peInvalidRequestLine, peInvalidContentLength, peUnexpectedBody, peInvalidTransferEncoding, peInvalidChunkHex, peInvalidLastChunk, peExpectingUnsignedInt } |
Parse results returned by the parse functions. More... | |
![]() | |
static std::string | getParseResultAsString (ParseError error) |
Return the string description of a ParseError. More... | |
A HTTP response line.
Definition at line 161 of file httpresponse.hpp.
|
inline |
Default constructor.
Definition at line 167 of file httpresponse.hpp.
|
inlineexplicit |
Explicit consructor.
version | The version to set. |
http_code | The HTTP code to set. |
Definition at line 174 of file httpresponse.hpp.
|
virtual |
Convert the HTTPResponseLine to a HTTP string.
Implements dodo::network::protocol::http::HTTPFragment.
Definition at line 99 of file httpresponse.cpp.
References dodo::network::protocol::http::HTTPVersion::asString(), dodo::network::protocol::http::HTTPMessage::charCR, dodo::network::protocol::http::HTTPMessage::charLF, dodo::network::protocol::http::HTTPMessage::charSP, http_code_, dodo::network::protocol::http::HTTPResponse::HTTPCodeAsString(), and version_.
Referenced by dodo::network::protocol::http::HTTPResponse::asString(), and dodo::network::protocol::http::HTTPResponse::send().
|
inline |
The HTTP return code of the HTTPResponse.
Definition at line 194 of file httpresponse.hpp.
|
inline |
The HTTPVersion of the response line.
Definition at line 188 of file httpresponse.hpp.
References version_.
|
virtual |
Read a complete HTTPFragment from a VirtualReadBuffer.
buffer | the VirtualReadBuffer to get characters from. |
Implements dodo::network::protocol::http::HTTPFragment.
Definition at line 111 of file httpresponse.cpp.
References dodo::network::protocol::http::HTTPMessage::charCR, dodo::network::protocol::http::HTTPMessage::charLF, dodo::network::protocol::http::HTTPMessage::eatSpace(), dodo::common::SystemError::ecOK, dodo::network::VirtualReadBuffer::get(), dodo::network::VirtualReadBuffer::next(), dodo::network::protocol::http::HTTPFragment::ParseResult::ok(), dodo::network::protocol::http::HTTPMessage::parseUInt(), dodo::network::protocol::http::HTTPFragment::peExpectCRLF, and dodo::network::protocol::http::HTTPFragment::ParseResult::setSystemError().
Referenced by dodo::network::protocol::http::HTTPResponse::parse().
|
private |
|
private |
The HTTPVersion.
Definition at line 194 of file httpresponse.hpp.
Referenced by asString(), and getHTTPVersion().