NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
websocketpp::http::parser Namespace Reference

Namespaces

 body_encoding
 
 state
 

Classes

class  parser
 Base HTTP parser. More...
 
class  request
 Stores, parses, and manipulates HTTP requests. More...
 
class  response
 Stores, parses, and manipulates HTTP responses. More...
 

Typedefs

typedef std::map< std::string, std::string, utility::ci_lessheader_list
 

Functions

template<typename InputIterator >
std::pair< std::string, InputIterator > extract_token (InputIterator begin, InputIterator end)
 Read and return the next token in the stream. More...
 
template<typename InputIterator >
std::pair< std::string, InputIterator > extract_quoted_string (InputIterator begin, InputIterator end)
 Read and return the next quoted string in the stream. More...
 
template<typename InputIterator >
InputIterator extract_lws (InputIterator begin, InputIterator end)
 Read and discard one unit of linear whitespace. More...
 
template<typename InputIterator >
InputIterator extract_all_lws (InputIterator begin, InputIterator end)
 Read and discard linear whitespace. More...
 
template<typename InputIterator >
InputIterator extract_attributes (InputIterator begin, InputIterator end, attribute_list &attributes)
 Extract HTTP attributes. More...
 
template<typename InputIterator >
InputIterator extract_parameters (InputIterator begin, InputIterator end, parameter_list &parameters)
 Extract HTTP parameters. More...
 
std::string strip_lws (std::string const &input)
 

Typedef Documentation

◆ header_list

typedef std::map<std::string, std::string, utility::ci_less > websocketpp::http::parser::header_list

Definition at line 60 of file parser.hpp.

Function Documentation

◆ extract_token()

template<typename InputIterator >
std::pair<std::string,InputIterator> websocketpp::http::parser::extract_token ( InputIterator  begin,
InputIterator  end 
)

Read and return the next token in the stream.

Read until a non-token character is found and then return the token and iterator to the next character to read

Parameters
beginAn iterator to the beginning of the sequence
endAn iterator to the end of the sequence
Returns
A pair containing the token and an iterator to the next character in the stream

Definition at line 73 of file parser.hpp.

References websocketpp::http::is_not_token_char().

Referenced by BOOST_AUTO_TEST_CASE(), extract_attributes(), and extract_parameters().

◆ extract_quoted_string()

template<typename InputIterator >
std::pair<std::string,InputIterator> websocketpp::http::parser::extract_quoted_string ( InputIterator  begin,
InputIterator  end 
)

Read and return the next quoted string in the stream.

Read a double quoted string starting at begin. The quotes themselves are stripped. The quoted value is returned along with an iterator to the next character to read

Parameters
beginAn iterator to the beginning of the sequence
endAn iterator to the end of the sequence
Returns
A pair containing the string read and an iterator to the next character in the stream

Definition at line 92 of file parser.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and extract_attributes().

◆ extract_lws()

template<typename InputIterator >
InputIterator websocketpp::http::parser::extract_lws ( InputIterator  begin,
InputIterator  end 
)

Read and discard one unit of linear whitespace.

Read one unit of linear white space and return the iterator to the character afterwards. If begin is returned, no whitespace was extracted.

Parameters
beginAn iterator to the beginning of the sequence
endAn iterator to the end of the sequence
Returns
An iterator to the character after the linear whitespace read

Definition at line 139 of file parser.hpp.

References websocketpp::http::is_not_whitespace_char(), and websocketpp::http::is_whitespace_char().

Referenced by extract_all_lws().

◆ extract_all_lws()

template<typename InputIterator >
InputIterator websocketpp::http::parser::extract_all_lws ( InputIterator  begin,
InputIterator  end 
)

Read and discard linear whitespace.

Read linear white space until a non-lws character is read and return an iterator to that character. If begin is returned, no whitespace was extracted.

Parameters
beginAn iterator to the beginning of the sequence
endAn iterator to the end of the sequence
Returns
An iterator to the character after the linear whitespace read

Definition at line 164 of file parser.hpp.

References extract_lws().

Referenced by BOOST_AUTO_TEST_CASE(), extract_attributes(), extract_parameters(), and strip_lws().

◆ extract_attributes()

template<typename InputIterator >
InputIterator websocketpp::http::parser::extract_attributes ( InputIterator  begin,
InputIterator  end,
attribute_list attributes 
)

Extract HTTP attributes.

An http attributes list is a semicolon delimited list of key value pairs in the format: *( ";" attribute "=" value ) where attribute is a token and value is a token or quoted string.

Attributes extracted are appended to the supplied attributes list attributes.

Parameters
[in]beginAn iterator to the beginning of the sequence
[in]endAn iterator to the end of the sequence
[out]attributesA reference to the attributes list to append attribute/value pairs extracted to
Returns
An iterator to the character after the last atribute read

Definition at line 195 of file parser.hpp.

References extract_all_lws(), extract_quoted_string(), and extract_token().

Referenced by BOOST_AUTO_TEST_CASE(), and extract_parameters().

◆ extract_parameters()

template<typename InputIterator >
InputIterator websocketpp::http::parser::extract_parameters ( InputIterator  begin,
InputIterator  end,
parameter_list parameters 
)

Extract HTTP parameters.

An http parameters list is a comma delimited list of tokens followed by optional semicolon delimited attributes lists.

Parameters extracted are appended to the supplied parameters list parameters.

Parameters
[in]beginAn iterator to the beginning of the sequence
[in]endAn iterator to the end of the sequence
[out]parametersA reference to the parameters list to append paramter values extracted to
Returns
An iterator to the character after the last parameter read

Definition at line 293 of file parser.hpp.

References extract_all_lws(), extract_attributes(), and extract_token().

Referenced by BOOST_AUTO_TEST_CASE(), and websocketpp::http::parser::parser::parse_parameter_list().

◆ strip_lws()

std::string websocketpp::http::parser::strip_lws ( std::string const &  input)
inline