List of all members
cgicc::HTTPHeader Class Referenceabstract

Abstract base class for all simple HTTP response headers. More...

#include <cgicc/HTTPHeader.h>

Inheritance diagram for cgicc::HTTPHeader:
cgicc::MStreamable cgicc::HTTPContentHeader cgicc::HTTPRedirectHeader cgicc::HTTPStatusHeader cgicc::HTTPHTMLHeader cgicc::HTTPPlainHeader cgicc::HTTPXHTMLHeader

Public Member Functions

Constructors and Destructor
 HTTPHeader (const std::string &data)
 Constructor.
 
 HTTPHeader (const HTTPHeader &header)
 Copy constructor.
 
virtual ~HTTPHeader ()
 Destructor.
 
Cookie Management
HTTPHeadersetCookie (const HTTPCookie &cookie)
 Set a cookie to go out with this HTTPResponseHeader.
 
const std::vector< HTTPCookie > & getCookies () const
 Get a list of all cookies associated with this header.
 
Accessor Method
std::string getData () const
 
- Public Member Functions inherited from cgicc::MStreamable
 MStreamable ()
 Empty constructor.
 
virtual ~MStreamable ()
 Empty destructor.
 
virtual void render (std::ostream &out) const =0
 Write this object to a stream.

 

Subclass Methods

virtual void render (std::ostream &out) const =0
 Write this HTTPHeader to a stream.

 

Detailed Description

Abstract base class for all simple HTTP response headers.

Definition at line 52 of file HTTPHeader.h.

Constructor & Destructor Documentation

◆ HTTPHeader() [1/2]

cgicc::HTTPHeader::HTTPHeader ( const std::string &  data)

Constructor.

Parameters
dataThe header data.

◆ HTTPHeader() [2/2]

cgicc::HTTPHeader::HTTPHeader ( const HTTPHeader header)

Copy constructor.

Parameters
headerThe HTTPHeader to copy.

◆ ~HTTPHeader()

virtual cgicc::HTTPHeader::~HTTPHeader ( )
virtual

Destructor.

Member Function Documentation

◆ getCookies()

const std::vector< HTTPCookie > & cgicc::HTTPHeader::getCookies ( ) const
inline

Get a list of all cookies associated with this header.

Returns
All the cookies associated with this header

Definition at line 96 of file HTTPHeader.h.

◆ getData()

std::string cgicc::HTTPHeader::getData ( ) const
inline

Get the data contained in this HTTP header.

Returns
The data contained in this header.

Definition at line 110 of file HTTPHeader.h.

◆ render()

virtual void cgicc::HTTPHeader::render ( std::ostream &  out) const
pure virtual

Write this HTTPHeader to a stream.

Subclasses must implement this function.

Parameters
outThe ostream to which to write.

Implements cgicc::MStreamable.

Implemented in cgicc::HTTPContentHeader, cgicc::HTTPRedirectHeader, and cgicc::HTTPStatusHeader.

◆ setCookie()

HTTPHeader & cgicc::HTTPHeader::setCookie ( const HTTPCookie cookie)
inline

Set a cookie to go out with this HTTPResponseHeader.

Parameters
cookieThe HTTPCookie to set

Definition at line 88 of file HTTPHeader.h.

Referenced by main().


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

GNU cgicc - A C++ class library for writing CGI applications
Copyright © 1996 - 2004 Stephen F. Booth
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front Cover Texts, and with no Back-Cover Texts.
Documentation generated Fri Mar 1 2024 08:39:43 for cgicc by doxygen 1.9.6