Boost logo

Boost-Commit :

From: lists.drrngrvy_at_[hidden]
Date: 2007-10-16 17:14:45


Author: drrngrvy
Date: 2007-10-16 17:14:45 EDT (Tue, 16 Oct 2007)
New Revision: 40097
URL: http://svn.boost.org/trac/boost/changeset/40097

Log:
Fixing boost/cgi/cookie.hpp from last commit
Text files modified:
   sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp | 13 +++++--------
   sandbox/SOC/2007/cgi/boost/cgi/cookie.hpp | 22 ++++++++++++++--------
   2 files changed, 19 insertions(+), 16 deletions(-)

Modified: sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/cgi.hpp 2007-10-16 17:14:45 EDT (Tue, 16 Oct 2007)
@@ -10,20 +10,17 @@
 #define CGI_CGI_HPP_INCLUDED__
 
 // Include all cgi-related headers only.
-#include "cgi/request.hpp"
-#include "cgi/service.hpp"
+#include "boost/cgi/request.hpp"
+#include "boost/cgi/service.hpp"
 
 // Include headers common to all protocols
-#include "detail/common_headers.hpp"
+#include "boost/cgi/detail/common_headers.hpp"
 
 namespace cgi {
- namespace cgi {
 
- typedef ::cgi::cgi_request request;
+ typedef cgi_request request;
   //typedef cgi::cgi_service service; // to be added
- using namespace ::cgi;
-
- } // namespace cgi
+
 } // namespace cgi
 
 #endif // CGI_CGI_HPP_INCLUDED__

Modified: sandbox/SOC/2007/cgi/boost/cgi/cookie.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/boost/cgi/cookie.hpp (original)
+++ sandbox/SOC/2007/cgi/boost/cgi/cookie.hpp 2007-10-16 17:14:45 EDT (Tue, 16 Oct 2007)
@@ -11,7 +11,7 @@
 
 #include <string>
 #include <boost/system/error_code.hpp>
-#include <boost/tokenizer/
+#include <boost/tokenizer.hpp>
 
 namespace cgi {
 
@@ -117,18 +117,24 @@
       return from_string(str.c_str(), ec);
     }
     */
+
+ /// Make a string out of the cookie
+ std::string to_string()
+ {
+ std::string str(ck.name + "=" + ck.value);
+ if (!ck.expires.empty()) str += "; expires=" += ck.expires;
+ if (!ck.path.empty() ) str += "; path=" += ck.path;
+ if (!ck.domain.empty() ) str += "; domain=" += ck.domain;
+ if ( secure ) str += "; secure";
+ if ( ck.http_only ) str += "; HttpOnly";
+ return str;
+ }
   };
 
   template<typename OutStream, typename Cookie>
     OutStream& operator<<(OutStream& os, Cookie ck)
   {
- os<< ck.name << "=" << ck.value;
- if (!ck.expires.empty()) os<< "; expires=" << ck.expires;
- if (!ck.path.empty() ) os<< "; path=" << ck.path;
- if (!ck.domain.empty() ) os<< "; domain=" << ck.domain;
- if ( secure ) os<< "; secure";
- if ( ck.http_only ) os<< "; HttpOnly";
- return os;
+ return os<< ck.to_string();
   }
 
 } // namespace cgi


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk