Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

HTTPCookie.h

Go to the documentation of this file.
00001 /* -*-c++-*- */
00002 /*
00003  *  $Id: HTTPCookie_8h-source.html,v 1.1.1.3 2004/06/19 04:36:23 chrisb Exp $
00004  *
00005  *  Copyright (C) 1996 - 2003 Stephen F. Booth
00006  *
00007  *  This library is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU Lesser General Public
00009  *  License as published by the Free Software Foundation; either
00010  *  version 2.1 of the License, or (at your option) any later version.
00011  *
00012  *  This library is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU Lesser General Public
00018  *  License along with this library; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  */
00021 
00022 #ifndef _HTTPCOOKIE_H_
00023 #define _HTTPCOOKIE_H_ 1
00024 
00025 #ifdef __GNUG__
00026 #  pragma interface
00027 #endif
00028 
00033 #include <string>
00034 
00035 #include "cgicc/MStreamable.h"
00036 #include "cgicc/CgiDefs.h"
00037 
00038 namespace cgicc {
00039   
00040   // ============================================================
00041   // Class HTTPCookie
00042   // ============================================================
00056   class CGICC_API HTTPCookie : public MStreamable 
00057   {
00058   public:
00059     
00062     
00068     HTTPCookie();
00069     
00077     HTTPCookie(const std::string& name, 
00078                const std::string& value);
00079     
00096     HTTPCookie(const std::string& name, 
00097                const std::string& value, 
00098                const std::string& comment, 
00099                const std::string& domain, 
00100                unsigned long maxAge, 
00101                const std::string& path,
00102                bool secure);
00103     
00111     HTTPCookie(const HTTPCookie& cookie);
00112     
00118     virtual ~HTTPCookie();
00120     
00121     // ============================================================
00122     
00125     
00134     bool 
00135     operator== (const HTTPCookie& cookie)       const;
00136     
00145     inline bool 
00146     operator != (const HTTPCookie& cookie)      const
00147     { return ! operator==(cookie); }
00148     
00149 #ifdef WIN32
00150     /* Dummy operator for MSVC++ */
00151     inline bool 
00152     operator< (const HTTPCookie& cookie)        const
00153     { return false; }
00154 #endif
00155 
00156     
00157     // ============================================================
00158     
00161     
00167     inline std::string 
00168     getName()                                   const
00169     { return fName; }
00170     
00176     inline std::string 
00177     getValue()                                  const
00178     { return fValue; }
00179     
00185     inline std::string 
00186     getComment()                                const
00187     { return fComment; }
00188     
00196     inline std::string 
00197     getDomain()                                 const
00198     { return fDomain; }
00199     
00205     inline unsigned long
00206     getMaxAge()                                 const
00207     { return fMaxAge; }
00208     
00216     inline std::string 
00217     getPath()                                   const
00218     { return fPath; }
00219     
00225     inline bool 
00226     isSecure()                                  const
00227     { return fSecure; }
00229     
00230     // ============================================================
00231     
00234     
00240     inline void 
00241     setName(const std::string& name)
00242     { fName = name; }
00243     
00249     inline void 
00250     setValue(const std::string& value)
00251     { fValue = value; }
00252     
00258     inline void 
00259     setComment(const std::string& comment)
00260     { fComment = comment; }
00261     
00270     inline void 
00271     setDomain(const std::string& domain)
00272     { fDomain = domain; }
00273     
00280     inline void 
00281     setMaxAge(unsigned long maxAge)
00282     { fMaxAge = maxAge; }
00283     
00291     inline void 
00292     setPath(const std::string& path)
00293     { fPath = path; }
00294     
00300     inline void 
00301     setSecure(bool secure)
00302     { fSecure = secure; }
00304     
00305     // ============================================================
00306     
00309     virtual void 
00310     render(std::ostream& out)                   const;
00312     
00313   private:
00314     std::string         fName;
00315     std::string         fValue;
00316     std::string         fComment;
00317     std::string         fDomain;
00318     unsigned long       fMaxAge;
00319     std::string         fPath;
00320     bool                fSecure;
00321   };
00322   
00323 } // namespace cgicc
00324 
00325 #endif /* ! _HTTPCOOKIE_H_ */

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 Sat Jun 19 00:36:23 2004 for cgicc by doxygen 1.3.6