Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

HTTPRedirectHeader.cpp

Go to the documentation of this file.
00001 /* -*-mode:c++; c-file-style: "gnu";-*- */
00002 /*
00003  *  $Id: HTTPRedirectHeader.cpp,v 1.8 2007/07/02 18:48:19 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 #ifdef __GNUG__
00025 #  pragma implementation
00026 #endif
00027 
00028 #include "cgicc/HTTPRedirectHeader.h"
00029 
00030 // ============================================================
00031 // Class HTTPRedirectHeader
00032 // ============================================================
00033 cgicc::HTTPRedirectHeader::HTTPRedirectHeader(const std::string& url) 
00034   : HTTPHeader(url)
00035 {}
00036 
00037 cgicc::HTTPRedirectHeader::~HTTPRedirectHeader()
00038 {}
00039 
00040 void 
00041 cgicc::HTTPRedirectHeader::render(std::ostream& out)    const
00042 {
00043   out << "Location: " << getData() << std::endl;
00044   
00045   if(false == getCookies().empty()) {
00046     std::vector<HTTPCookie>::const_iterator iter; 
00047     
00048     for(iter = getCookies().begin(); iter != getCookies().end(); ++iter)
00049       out << *iter << std::endl;
00050   }
00051   
00052   out << std::endl;
00053 }

© sourcejam.com 2005-2008