The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

HTTPHeaders Class Reference

A modifyable list of HTTP header fields. More...

#include <httpd.h>

Inheritance diagram for HTTPHeaders:

Inheritance graph
[legend]
Collaboration diagram for HTTPHeaders:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void SetHeader (const std::string &name, const std::string &data)
 Set the value of a header Sets the value of the named header.
void CreateHeader (const std::string &name, const std::string &data)
 Set the value of a header, only if it doesn't exist already Sets the value of the named header.
void RemoveHeader (const std::string &name)
 Remove the named header.
void Clear ()
 Remove all headers.
std::string GetHeader (const std::string &name)
 Get the value of a header.
bool IsSet (const std::string &name)
 Check if the given header is specified.
std::string GetFormattedHeaders ()
 Get all headers, formatted by the HTTP protocol.

Protected Attributes

std::map< std::string, std::stringheaders

Detailed Description

A modifyable list of HTTP header fields.

Definition at line 25 of file httpd.h.


Member Function Documentation

void HTTPHeaders::Clear  )  [inline]
 

Remove all headers.

Definition at line 57 of file httpd.h.

References headers.

void HTTPHeaders::CreateHeader const std::string name,
const std::string data
[inline]
 

Set the value of a header, only if it doesn't exist already Sets the value of the named header.

If the header is already present, it will NOT be updated

Definition at line 42 of file httpd.h.

References IsSet(), and SetHeader().

Referenced by HttpServerSocket::SendHeaders().

std::string HTTPHeaders::GetFormattedHeaders  )  [inline]
 

Get all headers, formatted by the HTTP protocol.

Returns:
Returns all headers, formatted according to the HTTP protocol. There is no request terminator at the end

Definition at line 86 of file httpd.h.

References headers.

Referenced by HttpServerSocket::SendHeaders().

std::string HTTPHeaders::GetHeader const std::string name  )  [inline]
 

Get the value of a header.

Returns:
The value of the header, or an empty string

Definition at line 65 of file httpd.h.

References headers.

Referenced by HttpServerSocket::CheckRequestBuffer(), and ModuleHTTPAccessList::OnEvent().

bool HTTPHeaders::IsSet const std::string name  )  [inline]
 

Check if the given header is specified.

Returns:
true if the header is specified

Definition at line 77 of file httpd.h.

References headers.

Referenced by HttpServerSocket::CheckRequestBuffer(), CreateHeader(), and ModuleHTTPAccessList::OnEvent().

void HTTPHeaders::RemoveHeader const std::string name  )  [inline]
 

Remove the named header.

Definition at line 50 of file httpd.h.

References headers.

Referenced by HttpServerSocket::SendHeaders().

void HTTPHeaders::SetHeader const std::string name,
const std::string data
[inline]
 

Set the value of a header Sets the value of the named header.

If the header is already present, it will be replaced

Definition at line 34 of file httpd.h.

References headers.

Referenced by ModuleHTTPAccessList::BlockAccess(), HttpServerSocket::CheckRequestBuffer(), CreateHeader(), ModuleRpcJson::OnEvent(), ModuleHttpStats::OnEvent(), and HttpServerSocket::SendHeaders().


Member Data Documentation

std::map<std::string,std::string> HTTPHeaders::headers [protected]
 

Definition at line 28 of file httpd.h.

Referenced by Clear(), GetFormattedHeaders(), GetHeader(), IsSet(), RemoveHeader(), and SetHeader().


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