dodo  0.0.1
A C++ library to create containerized Linux services
dodo::network::protocol::http::HTTPResponse::HTTPResponseLine Class Reference

A HTTP response line. More...

#include <httpresponse.hpp>

Inheritance diagram for dodo::network::protocol::http::HTTPResponse::HTTPResponseLine:
Collaboration diagram for dodo::network::protocol::http::HTTPResponse::HTTPResponseLine:

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 HTTPVersiongetHTTPVersion () 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

- Public Types inherited from dodo::network::protocol::http::HTTPFragment
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 Public Member Functions inherited from dodo::network::protocol::http::HTTPFragment
static std::string getParseResultAsString (ParseError error)
 Return the string description of a ParseError. More...
 

Detailed Description

A HTTP response line.

Definition at line 161 of file httpresponse.hpp.

Constructor & Destructor Documentation

◆ HTTPResponseLine() [1/2]

dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::HTTPResponseLine ( )
inline

Default constructor.

Definition at line 167 of file httpresponse.hpp.

◆ HTTPResponseLine() [2/2]

dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::HTTPResponseLine ( const HTTPVersion version,
HTTPCode  http_code 
)
inlineexplicit

Explicit consructor.

Parameters
versionThe version to set.
http_codeThe HTTP code to set.

Definition at line 174 of file httpresponse.hpp.

Member Function Documentation

◆ asString()

std::string dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::asString ( ) const
virtual

◆ getHTTPCode()

HTTPCode dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::getHTTPCode ( ) const
inline

The HTTP return code of the HTTPResponse.

Returns
The HTTPCode.

Definition at line 194 of file httpresponse.hpp.

◆ getHTTPVersion()

const HTTPVersion& dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::getHTTPVersion ( ) const
inline

The HTTPVersion of the response line.

Returns
The HTTPVersion

Definition at line 188 of file httpresponse.hpp.

References version_.

◆ parse()

Field Documentation

◆ http_code_

HTTPCode dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::http_code_
private

The http_code.

Definition at line 200 of file httpresponse.hpp.

Referenced by asString().

◆ version_

HTTPVersion dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::version_
private

The HTTPVersion.

Definition at line 194 of file httpresponse.hpp.

Referenced by asString(), and getHTTPVersion().


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