Crow  0.3
A C++ microframework for the web
crow::HTTPParser< Handler > Struct Template Reference

A wrapper for nodejs/http-parser. More...

#include <parser.h>

Inheritance diagram for crow::HTTPParser< Handler >:

Public Member Functions

 HTTPParser (Handler *handler)
bool feed (const char *buffer, int length)
 Parse a buffer into the different sections of an HTTP request.
bool done ()
void clear ()
void process_header ()
void process_message ()
request to_request () const
 Take the parsed HTTP request data and convert it to a crow::request.
bool is_upgrade () const
bool check_version (int major, int minor) const

Static Public Member Functions

static int on_message_begin (http_parser *self_)
static int on_url (http_parser *self_, const char *at, size_t length)
static int on_header_field (http_parser *self_, const char *at, size_t length)
static int on_header_value (http_parser *self_, const char *at, size_t length)
static int on_headers_complete (http_parser *self_)
static int on_body (http_parser *self_, const char *at, size_t length)
static int on_message_complete (http_parser *self_)

Public Attributes

std::string raw_url
std::string url
int header_building_state = 0
std::string header_field
std::string header_value
ci_map headers
query_string url_params
 What comes after the ? in the URL.
std::string body
Handler * handler_
 This is currently an HTTP connection object (crow::Connection).

Detailed Description

template<typename Handler>
struct crow::HTTPParser< Handler >

A wrapper for nodejs/http-parser.

Used to generate a crow::request from the TCP socket buffer.

The documentation for this struct was generated from the following file: