Electroneum
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
crow::HTTPParser< Handler > Struct Template Reference

#include <parser.h>

Inheritance diagram for crow::HTTPParser< Handler >:
Inheritance graph
[legend]
Collaboration diagram for crow::HTTPParser< Handler >:
Collaboration graph
[legend]

Public Member Functions

 HTTPParser (Handler *handler)
 
bool feed (const char *buffer, int length)
 
bool done ()
 
void clear ()
 
void process_header ()
 
void process_message ()
 
request to_request () const
 
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
 
std::string body
 
Handler * handler_
 
- Public Attributes inherited from http_parser
unsigned int type: 2
 
unsigned int flags: 6
 
unsigned int state: 8
 
unsigned int header_state: 8
 
unsigned int index: 8
 
uint32_t nread
 
uint64_t content_length
 
unsigned short http_major
 
unsigned short http_minor
 
unsigned int status_code: 16
 
unsigned int method: 8
 
unsigned int http_errno: 7
 
unsigned int upgrade: 1
 
void * data
 

Constructor & Destructor Documentation

◆ HTTPParser()

template<typename Handler>
crow::HTTPParser< Handler >::HTTPParser ( Handler *  handler)
inline

Member Function Documentation

◆ check_version()

template<typename Handler>
bool crow::HTTPParser< Handler >::check_version ( int  major,
int  minor 
) const
inline

◆ clear()

template<typename Handler>
void crow::HTTPParser< Handler >::clear ( )
inline

◆ done()

template<typename Handler>
bool crow::HTTPParser< Handler >::done ( )
inline

◆ feed()

template<typename Handler>
bool crow::HTTPParser< Handler >::feed ( const char *  buffer,
int  length 
)
inline

◆ is_upgrade()

template<typename Handler>
bool crow::HTTPParser< Handler >::is_upgrade ( ) const
inline

◆ on_body()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_body ( http_parser self_,
const char *  at,
size_t  length 
)
inlinestatic

◆ on_header_field()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_header_field ( http_parser self_,
const char *  at,
size_t  length 
)
inlinestatic

◆ on_header_value()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_header_value ( http_parser self_,
const char *  at,
size_t  length 
)
inlinestatic

◆ on_headers_complete()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_headers_complete ( http_parser self_)
inlinestatic

◆ on_message_begin()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_message_begin ( http_parser self_)
inlinestatic

◆ on_message_complete()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_message_complete ( http_parser self_)
inlinestatic

◆ on_url()

template<typename Handler>
static int crow::HTTPParser< Handler >::on_url ( http_parser self_,
const char *  at,
size_t  length 
)
inlinestatic

◆ process_header()

template<typename Handler>
void crow::HTTPParser< Handler >::process_header ( )
inline

◆ process_message()

template<typename Handler>
void crow::HTTPParser< Handler >::process_message ( )
inline

◆ to_request()

template<typename Handler>
request crow::HTTPParser< Handler >::to_request ( ) const
inline

Member Data Documentation

◆ body

template<typename Handler>
std::string crow::HTTPParser< Handler >::body

◆ handler_

template<typename Handler>
Handler* crow::HTTPParser< Handler >::handler_

◆ header_building_state

template<typename Handler>
int crow::HTTPParser< Handler >::header_building_state = 0

◆ header_field

template<typename Handler>
std::string crow::HTTPParser< Handler >::header_field

◆ header_value

template<typename Handler>
std::string crow::HTTPParser< Handler >::header_value

◆ headers

template<typename Handler>
ci_map crow::HTTPParser< Handler >::headers

◆ raw_url

template<typename Handler>
std::string crow::HTTPParser< Handler >::raw_url

◆ url

template<typename Handler>
std::string crow::HTTPParser< Handler >::url

◆ url_params

template<typename Handler>
query_string crow::HTTPParser< Handler >::url_params

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