Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
async_web_server_cpp::HttpRequestParser Class Reference

#include <http_request_parser.hpp>

List of all members.

Public Member Functions

 HttpRequestParser ()
 Construct ready to parse the request method.
template<typename InputIterator >
boost::tuple< boost::tribool,
InputIterator > 
parse (HttpRequest &req, InputIterator begin, InputIterator end)
void reset ()
 Reset to initial parser state.

Private Types

enum  state {
  method_start, method, uri, http_version_h,
  http_version_t_1, http_version_t_2, http_version_p, http_version_slash,
  http_version_major_start, http_version_major, http_version_minor_start, http_version_minor,
  expecting_newline_1, header_line_start, header_lws, header_name,
  space_before_header_value, header_value, expecting_newline_2, expecting_newline_3
}
 The current state of the parser. More...

Private Member Functions

boost::tribool consume (HttpRequest &req, char input)
 Handle the next character of input.

Static Private Member Functions

static bool is_char (int c)
 Check if a byte is an HTTP character.
static bool is_ctl (int c)
 Check if a byte is an HTTP control character.
static bool is_digit (int c)
 Check if a byte is a digit.
static bool is_tspecial (int c)
 Check if a byte is defined as an HTTP tspecial character.

Private Attributes

enum
async_web_server_cpp::HttpRequestParser::state 
state_

Detailed Description

Definition at line 21 of file http_request_parser.hpp.


Member Enumeration Documentation

The current state of the parser.

Enumerator:
method_start 
method 
uri 
http_version_h 
http_version_t_1 
http_version_t_2 
http_version_p 
http_version_slash 
http_version_major_start 
http_version_major 
http_version_minor_start 
http_version_minor 
expecting_newline_1 
header_line_start 
header_lws 
header_name 
space_before_header_value 
header_value 
expecting_newline_2 
expecting_newline_3 

Definition at line 65 of file http_request_parser.hpp.


Constructor & Destructor Documentation

Construct ready to parse the request method.

Definition at line 15 of file http_request_parser.cpp.


Member Function Documentation

boost::tribool async_web_server_cpp::HttpRequestParser::consume ( HttpRequest req,
char  input 
) [private]

Handle the next character of input.

Definition at line 25 of file http_request_parser.cpp.

bool async_web_server_cpp::HttpRequestParser::is_char ( int  c) [static, private]

Check if a byte is an HTTP character.

Definition at line 283 of file http_request_parser.cpp.

bool async_web_server_cpp::HttpRequestParser::is_ctl ( int  c) [static, private]

Check if a byte is an HTTP control character.

Definition at line 288 of file http_request_parser.cpp.

bool async_web_server_cpp::HttpRequestParser::is_digit ( int  c) [static, private]

Check if a byte is a digit.

Definition at line 322 of file http_request_parser.cpp.

bool async_web_server_cpp::HttpRequestParser::is_tspecial ( int  c) [static, private]

Check if a byte is defined as an HTTP tspecial character.

Definition at line 293 of file http_request_parser.cpp.

template<typename InputIterator >
boost::tuple<boost::tribool, InputIterator> async_web_server_cpp::HttpRequestParser::parse ( HttpRequest req,
InputIterator  begin,
InputIterator  end 
) [inline]

Parse some data. The tribool return value is true when a complete request has been parsed, false if the data is invalid, indeterminate when more data is required. The InputIterator return value indicates how much of the input has been consumed.

Definition at line 35 of file http_request_parser.hpp.

Reset to initial parser state.

Definition at line 20 of file http_request_parser.cpp.


Member Data Documentation


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


async_web_server_cpp
Author(s): Mitchell Wills
autogenerated on Fri Mar 4 2016 11:30:14