cgicc: HTTPHeader.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# HTTPHeader.h

Go to the documentation of this file.

    00001 /* -*-mode:c++; c-file-style: "gnu";-*- */
    00002 /*
    00003  *  $Id: HTTPHeader.h,v 1.9 2007/07/02 18:48:18 sebdiaz Exp $
    00004  *
    00005  *  Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
    00006  *                       2007 Sebastien DIAZ <sebastien.diaz@gmail.com>
    00007  *  Part of the GNU cgicc library, http://www.gnu.org/software/cgicc
    00008  *
    00009  *  This library is free software; you can redistribute it and/or
    00010  *  modify it under the terms of the GNU Lesser General Public
    00011  *  License as published by the Free Software Foundation; either
    00012  *  version 3 of the License, or (at your option) any later version.
    00013  *
    00014  *  This library is distributed in the hope that it will be useful,
    00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00017  *  Lesser General Public License for more details.
    00018  *
    00019  *  You should have received a copy of the GNU Lesser General Public
    00020  *  License along with this library; if not, write to the Free Software
    00021  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
    00022  */
    00023
    00024 #ifndef _HTTPHEADER_H_
    00025 #define _HTTPHEADER_H_ 1
    00026
    00027 #ifdef __GNUG__
    00028 #  pragma interface
    00029 #endif
    00030
    00036 #include <string>
    00037 #include <vector>
    00038
    00039 #include "cgicc/MStreamable.h"
    00040 #include "cgicc/HTTPCookie.h"
    00041
    00042 namespace cgicc {
    00043
    00044   // ============================================================
    00045   // Class HTTPHeader
    00046   // ============================================================
    00047
    00052   class CGICC_API HTTPHeader : public MStreamable
    00053   {
    00054   public:
    00055
    00058
    00063     HTTPHeader(const std::string& data);
    00064
    00069     HTTPHeader(const HTTPHeader& header);
    00070
    00075     virtual ~HTTPHeader();
    00077
    00078     // ============================================================
    00079
    00082
    00087     inline HTTPHeader&
    00088     setCookie(const HTTPCookie& cookie)
    00089     { fCookies.push_back(cookie); return *this; }
    00090
    00095     inline const std::vector<HTTPCookie>&
    00096     getCookies()                                        const
    00097     { return fCookies; }
    00099
    00100     // ============================================================
    00101
    00104
    00109     inline std::string
    00110     getData()                                   const
    00111     { return fData; }
    00113
    00114     // ============================================================
    00115
    00118
    00125     virtual void
    00126     render(std::ostream& out)                   const = 0;
    00128
    00129   private:
    00130     HTTPHeader();
    00131
    00132     std::string fData;
    00133     std::vector<HTTPCookie> fCookies;
    00134   };
    00135
    00136 } // namespace cgicc
    00137
    00138 #endif /* ! _HTTPHEADER_H_ */