Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

HTTPHeaders Class Reference

Utility class to parse out interesting HTTP headers from a request or response. More...

#include <HTTPHeaders.h>

Inheritance diagram for HTTPHeaders:

HTTPRequest List of all members.

Static Public Member Functions

bool extract (const std::string &header, size_t hdrpos, size_t len, std::string *extract_hdr, std::string *extract_data, bool before_semi, const char *log)
 Parse a header line, copying out the header string and value.

bool extract (const std::string &header, size_t hdrpos, size_t len, const std::string &match, std::string *extract, bool before_semi, const char *log)
 Look in the header string for the expected http header and copy the value into the extract string.


Static Public Attributes

const std::string ContentLength
const std::string ContentType
const std::string Location
const std::string LastModified

Detailed Description

Utility class to parse out interesting HTTP headers from a request or response.

Definition at line 31 of file HTTPHeaders.h.


Member Function Documentation

bool HTTPHeaders::extract const std::string &  header,
size_t  hdrpos,
size_t  len,
const std::string &  match,
std::string *  extract,
bool  before_semi,
const char *  log
[static]
 

Look in the header string for the expected http header and copy the value into the extract string.

Parameters:
header the header data
hdrpos position in the string where the header line is
len length of the header line
match the header to extract
extract string to fill with the data
before_semi stop at a semicolon or not
log debug log target
Returns:
true if the header was found in the line

Definition at line 57 of file HTTPHeaders.cc.

References ASSERT, extract(), LOG_DEBUG, LOG_WARN, and logf().

bool HTTPHeaders::extract const std::string &  header,
size_t  hdrpos,
size_t  len,
std::string *  extract_hdr,
std::string *  extract_data,
bool  before_semi,
const char *  log
[static]
 

Parse a header line, copying out the header string and value.

Parameters:
header the header data
hdrpos position in the string where the header line is
len length of the header line
extract_hdr string to fill with the header string
extract_data string to fill with the header data
before_semi stop at a semicolon or not
log debug log target
Returns:
true if a header was found in the line

Definition at line 11 of file HTTPHeaders.cc.

References ASSERT, extract(), LOG_DEBUG, and logf().

Referenced by extract().


Member Data Documentation

const std::string HTTPHeaders::ContentLength [static]
 

const std::string HTTPHeaders::ContentType [static]
 

const std::string HTTPHeaders::LastModified [static]
 

const std::string HTTPHeaders::Location [static]
 


The documentation for this class was generated from the following files:
Generated on Fri Jun 25 08:57:12 2004 for tier by doxygen 1.3.7