dodo
0.0.1
A C++ library to create containerized Linux services
|
HHTP version comprising a major and minor number, convertable from and to string as in HTTP requests. More...
#include <httpversion.hpp>
Public Member Functions | |
HTTPVersion () | |
Default constructor to HTTP/1.0. More... | |
HTTPVersion (unsigned int major, unsigned int minor) | |
Construct from major and minor. More... | |
virtual std::string | asString () const |
Convert to string as 'HTTP/major_.minor_'. More... | |
unsigned int | getMajor () const |
Return the major version. More... | |
unsigned int | getMinor () const |
Return the minor version. More... | |
bool | operator< (const HTTPVersion &version) const |
Less-than operator. More... | |
HTTPVersion & | operator= (const HTTPVersion &version) |
Assignment operator. More... | |
bool | operator== (const HTTPVersion &version) const |
Equality operator. More... | |
bool | operator> (const HTTPVersion &version) const |
Greater than operator. More... | |
virtual ParseResult | parse (VirtualReadBuffer &buffer) |
Construct from current position in the VirtualReadBuffer 'HTTP/major_.minor_'. More... | |
Private Attributes | |
unsigned int | major_ |
The major version. More... | |
unsigned int | minor_ |
The minor version. 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... | |
HHTP version comprising a major and minor number, convertable from and to string as in HTTP requests.
Definition at line 38 of file httpversion.hpp.
|
inline |
Default constructor to HTTP/1.0.
Definition at line 43 of file httpversion.hpp.
|
inlineexplicit |
Construct from major and minor.
major | the major to set. |
minor | the minor to set. |
Definition at line 50 of file httpversion.hpp.
|
inlinevirtual |
Convert to string as 'HTTP/major_.minor_'.
Implements dodo::network::protocol::http::HTTPFragment.
Definition at line 56 of file httpversion.hpp.
References major_, and minor_.
Referenced by dodo::network::protocol::http::HTTPRequest::HTTPRequestLine::asString(), and dodo::network::protocol::http::HTTPResponse::HTTPResponseLine::asString().
|
inline |
Return the major version.
Definition at line 73 of file httpversion.hpp.
References major_.
|
inline |
Return the minor version.
Definition at line 79 of file httpversion.hpp.
References minor_.
|
inline |
Less-than operator.
version | The HTTPVersion to compare to. |
Definition at line 100 of file httpversion.hpp.
|
inline |
Assignment operator.
version | The version to assigne. |
Definition at line 86 of file httpversion.hpp.
|
inline |
Equality operator.
version | The HTTPVersion to compare to. |
Definition at line 93 of file httpversion.hpp.
|
inline |
Greater than operator.
version | The HTTPVersion to compare to. |
Definition at line 108 of file httpversion.hpp.
References major_.
|
virtual |
Construct from current position in the VirtualReadBuffer 'HTTP/major_.minor_'.
buffer | the VirtualReadBuffer to read from. |
Implements dodo::network::protocol::http::HTTPFragment.
Definition at line 32 of file httpversion.cpp.
References dodo::common::SystemError::ecOK, dodo::network::VirtualReadBuffer::get(), dodo::network::protocol::http::HTTPFragment::ParseResult::getSystemError(), major_, minor_, dodo::network::VirtualReadBuffer::next(), dodo::network::protocol::http::HTTPFragment::ParseResult::ok(), dodo::network::protocol::http::HTTPFragment::peInvalidHTTPVersion, and dodo::network::protocol::http::HTTPFragment::ParseResult::setSystemError().
|
private |
The major version.
Definition at line 109 of file httpversion.hpp.
Referenced by asString(), getMajor(), operator<(), operator=(), operator==(), operator>(), and parse().
|
private |
The minor version.
Definition at line 115 of file httpversion.hpp.
Referenced by asString(), getMinor(), operator<(), operator=(), operator==(), and parse().