Public Member Functions | List of all members
cgicc::HTTPStatusHeader Class Reference

HTTP header to set a specific request status. More...

#include <cgicc/HTTPStatusHeader.h>

Inheritance diagram for cgicc::HTTPStatusHeader:
cgicc::HTTPHeader cgicc::MStreamable

Public Member Functions

 HTTPStatusHeader (int status, const std::string &message)
 Create a new status header.
 
virtual ~HTTPStatusHeader ()
 Destructor.
 
int getStatusCode () const
 Get the status code associated with this header.
 
virtual void render (std::ostream &out) const
 Write this HTTPStatusHeader to a stream.

 
- Public Member Functions inherited from cgicc::HTTPHeader
 HTTPHeader (const std::string &data)
 Constructor.
 
 HTTPHeader (const HTTPHeader &header)
 Copy constructor.
 
virtual ~HTTPHeader ()
 Destructor.
 
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.
 
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.

 

Detailed Description

HTTP header to set a specific request status.

Definition at line 50 of file HTTPStatusHeader.h.

Constructor & Destructor Documentation

◆ HTTPStatusHeader()

cgicc::HTTPStatusHeader::HTTPStatusHeader ( int  status,
const std::string &  message 
)

Create a new status header.

Parameters
statusThe 3-digit status code, for example 404.
messageThe message associated with the status code, for example "not found".

Member Function Documentation

◆ getStatusCode()

int cgicc::HTTPStatusHeader::getStatusCode ( ) const
inline

Get the status code associated with this header.

Returns
The 3-digit status code of this header.

Definition at line 71 of file HTTPStatusHeader.h.

◆ render()

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

Write this HTTPStatusHeader to a stream.

Parameters
outThe ostream to which to write.

Implements cgicc::HTTPHeader.


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