SNode.C
|
#include <ResponseParser.h>
Public Member Functions | |
ResponseParser (core::socket::stream::SocketContext *socketContext, const std::function< void()> &onResponseStart, const std::function< void(Response &&)> &onResponseParsed, const std::function< void(int, const std::string &)> &onResponseParseError) | |
ResponseParser (const ResponseParser &)=delete | |
ResponseParser & | operator= (const ResponseParser &)=delete |
Response && | getResponse () |
![]() | |
Parser (core::socket::stream::SocketContext *socketContext, const enum HTTPCompliance &compliance=HTTPCompliance::RFC2616|HTTPCompliance::RFC7230) | |
virtual | ~Parser () |
std::size_t | parse () |
void | reset () |
Private Member Functions | |
void | begin () override |
void | parseStartLine (const std::string &line) override |
void | analyzeHeader () override |
void | parsingFinished () override |
void | parseError (int code, const std::string &reason) override |
Private Attributes | |
Response | response |
std::function< void()> | onResponseStart |
std::function< void(Response &&)> | onResponseParsed |
std::function< void(int, const std::string &)> | onResponseParseError |
Additional Inherited Members | |
![]() | |
enum struct | HTTPCompliance : unsigned short { RFC1945 = 0x01 << 0 , RFC2616 = 0x01 << 1 , RFC7230 = 0x01 << 2 , RFC7231 = 0x01 << 3 , RFC7232 = 0x01 << 4 , RFC7233 = 0x01 << 5 , RFC7234 = 0x01 << 6 , RFC7235 = 0x01 << 7 , RFC7540 = 0x01 << 8 , RFC7541 = 0x01 << 9 } |
enum struct | ParserState { BEGIN , FIRSTLINE , HEADER , BODY , TRAILER , ERROR } |
![]() | |
enum web::http::Parser::HTTPCompliance | hTTPCompliance |
ParserState | parserState = ParserState::BEGIN |
TransferEncoding | transferEncoding = TransferEncoding::HTTP10 |
CiStringMap< std::string > | headers |
std::vector< char > | content |
int | httpMajor = 0 |
int | httpMinor = 0 |
std::list< web::http::ContentDecoder * > | decoderQueue |
core::socket::stream::SocketContext * | socketContext = nullptr |
std::string | line |
std::size_t | contentLength = 0 |
std::size_t | contentLengthRead = 0 |
![]() | |
static const std::regex | httpVersionRegex |
Definition at line 41 of file ResponseParser.h.
web::http::client::ResponseParser::ResponseParser | ( | core::socket::stream::SocketContext * | socketContext, |
const std::function< void()> & | onResponseStart, | ||
const std::function< void(Response &&)> & | onResponseParsed, | ||
const std::function< void(int, const std::string &)> & | onResponseParseError ) |
Definition at line 37 of file ResponseParser.cpp.
|
delete |
|
overrideprivatevirtual |
Reimplemented from web::http::Parser.
Definition at line 88 of file ResponseParser.cpp.
References web::http::Parser::analyzeHeader(), web::http::Parser::BODY, web::http::Parser::parserState, and parsingFinished().
|
overrideprivatevirtual |
Implements web::http::Parser.
Definition at line 55 of file ResponseParser.cpp.
Response && web::http::client::ResponseParser::getResponse | ( | ) |
Definition at line 47 of file ResponseParser.cpp.
|
delete |
|
overrideprivatevirtual |
Implements web::http::Parser.
Definition at line 159 of file ResponseParser.cpp.
References web::http::Parser::ERROR, web::http::Parser::parserState, and web::http::Parser::reset().
|
overrideprivatevirtual |
Implements web::http::Parser.
Definition at line 59 of file ResponseParser.cpp.
References web::http::Parser::HEADER, and web::http::Parser::parserState.
|
overrideprivatevirtual |
Implements web::http::Parser.
Definition at line 146 of file ResponseParser.cpp.
References web::http::Parser::BEGIN, web::http::Parser::parserState, and web::http::Parser::reset().
Referenced by analyzeHeader().
|
private |
Definition at line 69 of file ResponseParser.h.
|
private |
Definition at line 70 of file ResponseParser.h.
|
private |
Definition at line 68 of file ResponseParser.h.
|
private |
Definition at line 65 of file ResponseParser.h.