My Project
 All Classes Functions Variables Pages
Public Member Functions | List of all members
HttpParser Class Reference

Public Member Functions

std::string getBody ()
 
std::string getHeader (const std::string &name)
 Retrieve the value of the named header. More...
 
std::map< std::string,
std::string > 
getHeaders ()
 
std::string getMethod ()
 
std::string getURL ()
 
std::string getVersion ()
 
std::string getStatus ()
 
std::string getReason ()
 
bool hasHeader (const std::string &name)
 Determine if we have a header of the given name. More...
 
void parse (std::string message)
 
void parse (Socket s)
 Parse socket data. More...
 
void parseResponse (std::string message)
 Parse a response message. More...
 

Member Function Documentation

std::string HttpParser::getHeader ( const std::string &  name)

Retrieve the value of the named header.

Parameters
[in]nameThe name of the header to retrieve.
Returns
The value of the named header or null if not present.
bool HttpParser::hasHeader ( const std::string &  name)

Determine if we have a header of the given name.

Parameters
[in]nameThe name of the header to find.
Returns
True if the header is present and false otherwise.
void HttpParser::parse ( Socket  s)

Parse socket data.

Parameters
[in]sThe socket from which to retrieve data.
void HttpParser::parseResponse ( std::string  message)

Parse a response message.

Parameters
[in]lineThe response to parse.

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