HTTPStatusHeader.h
Go to the documentation of this file.
1/* -*-mode:c++; c-file-style: "gnu";-*- */
2/*
3 * $Id: HTTPStatusHeader.h,v 1.8 2014/04/23 20:55:09 sebdiaz Exp $
4 *
5 * Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
6 * 2007 Sebastien DIAZ <sebastien.diaz@gmail.com>
7 * Part of the GNU cgicc library, http://www.gnu.org/software/cgicc
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 3 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
22 */
23
24#ifndef _HTTPSTATUSHEADER_H_
25#define _HTTPSTATUSHEADER_H_ 1
26
27#ifdef __GNUG__
28# pragma interface
29#endif
30
36#include <string>
37
38#include "HTTPHeader.h"
39
40 namespace cgicc {
41
42 // ============================================================
43 // Class HTTPStatusHeader
44 // ============================================================
45
50 class CGICC_API HTTPStatusHeader : public HTTPHeader
51 {
52 public:
53
60 HTTPStatusHeader(int status,
61 const std::string& message);
62
64 virtual ~HTTPStatusHeader();
65
70 inline int
71 getStatusCode() const
72 { return fStatus; }
73
74
79 virtual void
80 render(std::ostream& out) const;
81
82 private:
83 HTTPStatusHeader();
84 int fStatus;
85 };
86
87} // namespace cgicc
88
89#endif /* ! _HTTPSTATUSHEADER_H_ */
HTTPHeader.h
Abstract base class for simple HTTP headers.
cgicc::HTTPHeader
Abstract base class for all simple HTTP response headers.
Definition: HTTPHeader.h:53
cgicc::HTTPStatusHeader
HTTP header to set a specific request status.
Definition: HTTPStatusHeader.h:51
cgicc::HTTPStatusHeader::render
virtual void render(std::ostream &out) const
Write this HTTPStatusHeader to a stream.
cgicc::HTTPStatusHeader::getStatusCode
int getStatusCode() const
Get the status code associated with this header.
Definition: HTTPStatusHeader.h:71
cgicc::HTTPStatusHeader::~HTTPStatusHeader
virtual ~HTTPStatusHeader()
Destructor.
cgicc::HTTPStatusHeader::HTTPStatusHeader
HTTPStatusHeader(int status, const std::string &message)
Create a new status header.
cgicc
The namespace containing the cgicc library.
Definition: Cgicc.h:52