Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58387 - in sandbox/SOC/2007/cgi/branches/pickmeup: boost/cgi boost/cgi/cgi boost/cgi/common boost/cgi/detail boost/cgi/fcgi boost/cgi/impl libs/cgi/build/msvc/9.0/Boost.CGI libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo libs/cgi/build/msvc/9.0/Boost.CGI/cgi_file_browser libs/cgi/example/acgi/cookie_game libs/cgi/example/acgi/cookie_game2 libs/cgi/example/cgi/cookie_game2 libs/cgi/example/cgi/echo libs/cgi/example/cgi/hello_world
From: lists.drrngrvy_at_[hidden]
Date: 2009-12-14 17:38:24


Author: drrngrvy
Date: 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
New Revision: 58387
URL: http://svn.boost.org/trac/boost/changeset/58387

Log:
* Added http_cookie to request, previously missing
* Changed cookie_map to store a cookie. Added automatic conversion of a cookie to a string so that accessing request.cookies is just like using request.get or request.post.
* Cleaned up data_map_proxy, which is quite useful now.
* Added ability to optionally clear headers from a response.
* Changes to extract_params to make it more generic (ire. uses ADL and make_pair).
* Removed acgi examples (just use CGI now, which is always asynchronous).
Added:
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/
      - copied from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/cgi_cookie_game.vcproj
      - copied, changed from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game/
      - copied from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game/cgi_ctemplate_cookie_game.vcproj
      - copied, changed from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/index.html
      - copied, changed from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/index.html
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/main.cpp
      - copied, changed from r57598, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/main.js
      - copied unchanged from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.js
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/style.css
      - copied, changed from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/style.css
Removed:
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/acgi_cookie_game.vcproj
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/acgi_cookie_game.vcproj.360-SYSTEMS.darreng.user
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/Jamfile.v2
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/doc.qbk
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/index.html
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.js
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/style.css
Binary files modified:
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.suo
Text files modified:
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp | 4 ++
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/cgi/request_service.hpp | 1
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/cookie.hpp | 59 +++++++++++++++++++++++++++++++++------
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp | 43 ++++++++++++++++++++--------
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp | 6 +++
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp | 5 ++
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp | 7 ----
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp | 17 ++++++++--
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp | 23 ++++++++-------
   sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp | 11 ++++--
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln | 50 ++++++++++++---------------------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/cgi_cookie_game.vcproj | 28 +++---------------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game/cgi_ctemplate_cookie_game.vcproj | 16 +++++-----
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj | 24 ++--------------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_file_browser/cgi_file_browser.vcproj | 2
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game/main.cpp | 25 +++++++++++-----
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/index.html | 14 ++++++--
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/main.cpp | 18 ++++++------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/style.css | 4 ++
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp | 44 +++++++++++++----------------
   sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/hello_world/main.cpp | 39 ++++++++++++++++++-------
   21 files changed, 249 insertions(+), 191 deletions(-)

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/basic_request.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -600,6 +600,10 @@
     string_type& http_from ()
     { return env["HTTP_FROM"]; }
 
+ /// The cookies sent by the user making the request.
+ string_type& http_cookie ()
+ { return env["HTTP_COOKIE"]; }
+
     /// The role that the request is playing
     /**
      * The default role type is responder.

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/cgi/request_service.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/cgi/request_service.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/cgi/request_service.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -147,7 +147,6 @@
     int close(implementation_type& impl, common::http::status_code& http_s
       , int status, boost::system::error_code& ec)
     {
- std::cerr<< "In close." << std::endl;
       impl.status() = common::closed;
       impl.http_status() = http_s;
       return status;

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/cookie.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/cookie.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/cookie.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -9,12 +9,16 @@
 #ifndef CGI_COOKIE_HPP_INCLUDED__
 #define CGI_COOKIE_HPP_INCLUDED__
 
+#include <iostream>
 #include <string>
 #include <boost/system/error_code.hpp>
 #include <boost/tokenizer.hpp>
+#include "boost/cgi/common/name.hpp"
 #include "boost/cgi/config.hpp"
 
-#define BOOST_CGI_DATE_IN_THE_PAST "Fri, 05-Jun-1989 15:30:00 GMT"
+#ifndef BOOST_CGI_DATE_IN_THE_PAST
+# define BOOST_CGI_DATE_IN_THE_PAST "Fri, 05-Jun-1989 15:30:00 GMT"
+#endif // BOOST_CGI_DATE_IN_THE_PAST
 
 BOOST_CGI_NAMESPACE_BEGIN
 
@@ -45,6 +49,15 @@
     typedef typename std::basic_string<CharT> string_type;
 
     basic_cookie() {}
+ basic_cookie(const char* _name)
+ : name(_name)
+ , value()
+ , expires(BOOST_CGI_DATE_IN_THE_PAST)
+ , path("/")
+ , secure(false)
+ , http_only(false)
+ {
+ }
 
     /// Create a cookie for deleting the cookie named `_name`.
     basic_cookie(const string_type& _name)
@@ -140,20 +153,48 @@
       return str;
     }
     
- //friend std::ostream& operator<<(std::ostream& os, self_type const& ck);
+ operator const char_type () const { return value.c_str(); }
+ operator string_type const& () const { return value; }
+ operator string_type () const { return value; }
+ template<typename T>
+ operator std::basic_string<T> () { return value; }
+ //template<typename T>
+ //operator T () const { return value; }
+
+ template<typename T>
+ friend std::ostream& operator<<(std::ostream& os, basic_cookie<T> const& ck);
+ /*
+ template<typename T>
+ friend response& operator<< (response& resp, self_type const& ck) {
+ resp<< "Set-Cookie: " << ck.to_string();
+ return resp;
+ }
+ */
   };
 
- } // namespace common
-BOOST_CGI_NAMESPACE_END
+ inline
+ std::pair<common::name, common::cookie>
+ make_pair (const char* n, common::cookie& ck)
+ {
+ ck.value.swap(ck.name);
+ ck.name = n;
+ return std::make_pair(n, ck);
+ }
 
-/*
-template<typename OutStream, typename CharT>
-inline OutStream& operator<< (OutStream& os, BOOST_CGI_NAMESPACE::common::basic_cookie<CharT> const& ck)
+
+template<typename CharT>
+inline std::ostream& operator<< (std::ostream& os, BOOST_CGI_NAMESPACE::common::basic_cookie<CharT> const& ck)
 {
- os<< ck.to_string();
+ os<< ck.value;
   return os;
 }
-*/
+
+
+
+ } // namespace common
+
+BOOST_CGI_NAMESPACE_END
+
 
 #endif // CGI_COOKIE_HPP_INCLUDED__
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/data_map_proxy.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -61,22 +61,38 @@
        BOOST_ASSERT(impl);
        return impl->count(key);
     }
-
+
+ /// Get a value for the key, with fallback.
     mapped_type const&
- get(key_type const& key, mapped_type const& default_) const
+ pick(key_type const& key, mapped_type const& default_value) const
     {
       BOOST_ASSERT(impl);
       const_iterator iter = impl->find(key);
- return iter == impl->end() ? default_ : iter->second;
+ return iter == impl->end() ? default_value : iter->second;
     }
-
+
+ /// Get a value for the key as a specified type, with fallback.
+ /**
+ * @param key The name of CGI parameter to look for.
+ * @param default_value
+ * The default return value. If no data exists in the map
+ * for the specified key, or the data cannot be converted
+ * into the type of the default_ value, then this value is
+ * returned.
+ *
+ * If the key cannot be found, returns a default-constructed object
+ * of type T.
+ *
+ * If the key is found, attempts to convert the value into the type
+ * T. This throws a boost::bad_lexical_cast when it fails.
+ */
     template<typename T>
- T get_as(key_type const& key, T const& default_) const
+ T as(key_type const& key, T const& default_value = T()) const
     {
       BOOST_ASSERT(impl);
       const_iterator iter = impl->find(key);
 
- T val (default_);
+ T val (default_value);
 
       if (iter != impl->end()) {
         try {
@@ -88,13 +104,14 @@
       return val;
     }
     
- template<typename T>
- T as(key_type const& key) {
- BOOST_ASSERT(impl);
- const_iterator iter = impl->find(key);
- return iter == impl->end()
- ? T()
- : boost::lexical_cast<T>(val);
+ mapped_type& operator[](const char* varname) {
+ BOOST_ASSERT(impl);
+ return (*impl)[varname];
+ }
+
+ mapped_type& operator[](const char* varname) const {
+ BOOST_ASSERT(impl);
+ return (*impl)[varname];
     }
     
     mapped_type& operator[](key_type const& varname) {

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/map.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -3,6 +3,7 @@
 
 #include <map>
 #include "boost/cgi/common/name.hpp"
+#include "boost/cgi/common/cookie.hpp"
 
 /// You can define your
 #ifndef BOOST_CGI_SESSION_MAP_TYPE
@@ -29,7 +30,10 @@
   typedef map get_map;
   typedef map post_map;
   typedef map form_map;
- typedef map cookie_map;
+ typedef std::map<
+ ::BOOST_CGI_NAMESPACE::common::name,
+ ::BOOST_CGI_NAMESPACE::common::cookie
+ > cookie_map;
   typedef map session_map;
 
  } // namespace common

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/response.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -51,7 +51,7 @@
     ~basic_response();
 
     /// Clear the response buffer.
- void clear();
+ void clear(bool clear_headers = true);
 
     /// Return the response to the 'just constructed' state.
     void reset();
@@ -170,6 +170,9 @@
 
     /// Get the headers
     std::vector<string_type>& headers();
+
+ template<typename T>
+ friend self_type& operator<<(self_type& resp, T t);
 
   protected:
    // Vector of all the headers, each followed by a CRLF

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/common/source_enums.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -46,13 +46,6 @@
      session_map&
        session_vars(Impl& impl) { return boost::fusion::at_c<4>(impl); }
 
-/// This is used in `class basic_request<>` to add the request data accessors operators.
-#define BOOST_CGI_DETAIL_MAP_ACCESS(x) \
- x##_map& operator[](common::##x##_data_type const&) \
- { \
- return x##_vars(this->implementation.vars_); \
- }
-
  } // namespace common
 BOOST_CGI_NAMESPACE_END
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/detail/extract_params.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -14,6 +14,7 @@
 #include <boost/system/error_code.hpp>
 
 #include "boost/cgi/detail/url_decode.hpp"
+#include "boost/cgi/common/cookie.hpp"
 
 BOOST_CGI_NAMESPACE_BEGIN
  namespace detail {
@@ -36,11 +37,14 @@
 
      typedef typename boost::tokenizer<Separator> tokenizer;
      typedef typename Map::value_type value_type;
+ typedef typename Map::mapped_type mapped_type;
 
      tokenizer toker(input, separator);
 
      std::string name, current_token;
 
+ using std::make_pair;
+
      for(typename tokenizer::iterator iter = toker.begin()
         ; iter != toker.end()
         ; ++iter)
@@ -58,12 +62,15 @@
 // on by default).
 // Note that you'll want to check that your server keeps empty query string
 // parameters.
+ mapped_type val(name.empty() ? "" : current_token);
 #if defined(BOOST_CGI_KEEP_EMPTY_VARS)
          if (name.empty())
- destination.insert(value_type(current_token.c_str(), ""));
+ destination.insert(
+ make_pair(current_token.c_str(), val));
          else
 #endif // BOOST_CGI_KEEP_EMPTY_VARS
- destination.insert(value_type(name.c_str(), current_token));
+ destination.insert(
+ make_pair(name.c_str(), val));
          current_token.clear();
          name.clear();
        }else
@@ -71,13 +78,15 @@
          current_token = url_decode(*iter);
        }
      }
+
+ mapped_type val(name.empty() ? "" : current_token);
      // Save the name if the last n/v pair has no value.
      if ( !name.empty() )
- destination.insert(value_type(name.c_str(), current_token));
+ destination.insert(make_pair(name.c_str(), val));
 #if defined(BOOST_CGI_KEEP_EMPTY_VARS)
      else // Save the final 'toggle' - eg /path/to/script?foo=bar&toggle
      if ( !current_token.empty() )
- destination.insert(value_type(current_token.c_str(), ""));
+ destination.insert(make_pair(current_token.c_str(), val));
 #endif
 
      return ec;

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/fcgi/acceptor_service_impl.hpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -63,20 +63,23 @@
   /// The service_impl class for FCGI basic_request_acceptor<>s
    /**
     * Note: this is near enough to being generic. It will hopefully translate
- * directly to the fcgi_acceptor_service_impl. In other words you would
- * then have one acceptor_service_impl<>, so you'd use
+ * directly to the fcgi_acceptor_service_impl. In other words you
+ * would then have one acceptor_service_impl<>, so you'd use
     * acceptor_service_impl<scgi> acceptor_service_impl_; // and
     * acceptor_service_impl<fcgi> acceptor_service_impl_; // etc...
     *
- * Note: If the protocol is an asynchronous protocol, which means it requires
- * access to a boost::asio::io_service instance, then this class becomes a
- * model of the Service concept (**LINK**) and must only use the constructor
- * which takes a ProtocolService (**LINK**). If the protocol isn't async then
- * the class can be used without a ProtocolService.
+ * Note: If the protocol is an asynchronous protocol, which means it
+ * requires access to a boost::asio::io_service instance, then this
+ * class becomes a model of the Service concept (**LINK**) and must
+ * only use the constructor which takes a ProtocolService (**LINK**).
+ * If the protocol isn't async then the class can be used without a
+ * ProtocolService.
     */
    template<typename Protocol_ = ::BOOST_CGI_NAMESPACE::common::fcgi_>
    class acceptor_service_impl
- : public detail::service_base< ::BOOST_CGI_NAMESPACE::fcgi::acceptor_service_impl<Protocol_> >
+ : public detail::service_base<
+ ::BOOST_CGI_NAMESPACE::fcgi::acceptor_service_impl<Protocol_>
+ >
    {
    public:
 
@@ -108,9 +111,7 @@
      };
 
      typedef acceptor_service_impl<Protocol_> type;
- typedef typename
- type::implementation_type::protocol_type
- protocol_type;
+ typedef Protocol_ protocol_type;
      typedef typename
        type::implementation_type::protocol_service_type
                                                          protocol_service_type;

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/boost/cgi/impl/response.ipp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -110,11 +110,15 @@
 
     /// Clear the response buffer.
   template<typename T> BOOST_CGI_INLINE
- void basic_response<T>::clear()
+ void basic_response<T>::clear(bool clear_headers)
   {
     ostream_.clear();
- headers_.clear();
- headers_terminated_ = false;
+ buffer_.reset(new common::streambuf);
+ ostream_.rdbuf(buffer_.get());
+ if (clear_headers) {
+ headers_.clear();
+ headers_terminated_ = false;
+ }
   }
 
   /// Return the response to the 'just constructed' state.
@@ -339,7 +343,6 @@
       ) {
         body += *iter;
       }
- if (!headers_terminated_) body += "\r\n";
     }
     
     body += string_type(

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.sln 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -1,12 +1,6 @@
 ï»¿
 Microsoft Visual Studio Solution File, Format Version 10.00
 # Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_cookie_game", "acgi_cookie_game\acgi_cookie_game.vcproj", "{7B825743-52B4-44DC-932F-29F4D2547F38}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_echo", "acgi_echo\acgi_echo.vcproj", "{83BF52DF-C606-4BB7-B06F-EDC28DE829B1}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_ctemplate_cookie_game", "acgi_ctemplate_cookie_game\acgi_ctemplate_cookie_game.vcproj", "{AC2E336C-7C32-468C-9847-470436CF668F}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_ctemplate_debug_server", "cgi_ctemplate_debug_server\cgi_ctemplate_debug_server.vcproj", "{CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xcgi_accept", "xcgi_accept\xcgi_accept.vcproj", "{D24DD1E5-B8E3-4686-AB93-D17D44A73730}"
@@ -17,8 +11,6 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_debug_server", "cgi_debug_server\cgi_debug_server.vcproj", "{730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "acgi_hello_world", "acgi_hello_world\acgi_hello_world.vcproj", "{FEAD8671-B7BE-4F52-A308-6B337171F0B6}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_hello_world", "fcgi_hello_world\fcgi_hello_world.vcproj", "{9FACC40E-538D-4625-B8C7-7B2BC57B88BC}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_echo", "fcgi_echo\fcgi_echo.vcproj", "{6DA098F9-2F63-42F4-A732-48E6B35ECD1F}"
@@ -31,30 +23,22 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_file_browser", "fcgi_file_browser\fcgi_file_browser.vcproj", "{54333641-E5E5-4B30-A9D4-1054BFA95511}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_file_browser", "cgi_file_browser\cgi_file_browser.vcproj", "{FFF275FA-323A-4699-9D04-A5C9BDD6048B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_file_browser_debug", "cgi_file_browser_debug\cgi_file_browser_debug.vcproj", "{E266C18C-F482-459C-9805-EBAF5C68E50A}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_file_browser", "cgi_file_browser_debug\cgi_file_browser_debug.vcproj", "{E266C18C-F482-459C-9805-EBAF5C68E50A}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fcgi_speed_check", "fcgi_speed_check\fcgi_speed_check.vcproj", "{8F7D1DD8-FE44-419B-BE93-6A78C708ACDA}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_cookie_game", "cgi_cookie_game\cgi_cookie_game.vcproj", "{10157442-F0A7-4D8D-8169-242F44FCF035}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_ctemplate_cookie_game", "cgi_ctemplate_cookie_game\cgi_ctemplate_cookie_game.vcproj", "{C18D47EA-742B-4256-8D9B-A3D2A1EB6E1C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgi_stencil", "cgi_stencil\cgi_stencil.vcproj", "{B08A2E6D-9973-42F3-9621-90F3BD4A1721}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
                 Release|Win32 = Release|Win32
         EndGlobalSection
         GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7B825743-52B4-44DC-932F-29F4D2547F38}.Debug|Win32.ActiveCfg = Debug|Win32
- {7B825743-52B4-44DC-932F-29F4D2547F38}.Debug|Win32.Build.0 = Debug|Win32
- {7B825743-52B4-44DC-932F-29F4D2547F38}.Release|Win32.ActiveCfg = Release|Win32
- {7B825743-52B4-44DC-932F-29F4D2547F38}.Release|Win32.Build.0 = Release|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Debug|Win32.ActiveCfg = Debug|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Debug|Win32.Build.0 = Debug|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Release|Win32.ActiveCfg = Release|Win32
- {83BF52DF-C606-4BB7-B06F-EDC28DE829B1}.Release|Win32.Build.0 = Release|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Debug|Win32.ActiveCfg = Debug|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Debug|Win32.Build.0 = Debug|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Release|Win32.ActiveCfg = Release|Win32
- {AC2E336C-7C32-468C-9847-470436CF668F}.Release|Win32.Build.0 = Release|Win32
                 {CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}.Debug|Win32.ActiveCfg = Debug|Win32
                 {CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}.Debug|Win32.Build.0 = Debug|Win32
                 {CED278B4-18C9-41F5-9026-1DB8CD0AC5D4}.Release|Win32.ActiveCfg = Release|Win32
@@ -74,10 +58,6 @@
                 {730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}.Debug|Win32.Build.0 = Debug|Win32
                 {730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}.Release|Win32.ActiveCfg = Release|Win32
                 {730E95B0-DEBE-4CEB-9E9D-9C2A521ACC05}.Release|Win32.Build.0 = Release|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Debug|Win32.ActiveCfg = Debug|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Debug|Win32.Build.0 = Debug|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Release|Win32.ActiveCfg = Release|Win32
- {FEAD8671-B7BE-4F52-A308-6B337171F0B6}.Release|Win32.Build.0 = Release|Win32
                 {9FACC40E-538D-4625-B8C7-7B2BC57B88BC}.Debug|Win32.ActiveCfg = Debug|Win32
                 {9FACC40E-538D-4625-B8C7-7B2BC57B88BC}.Debug|Win32.Build.0 = Debug|Win32
                 {9FACC40E-538D-4625-B8C7-7B2BC57B88BC}.Release|Win32.ActiveCfg = Release|Win32
@@ -102,10 +82,6 @@
                 {54333641-E5E5-4B30-A9D4-1054BFA95511}.Debug|Win32.Build.0 = Debug|Win32
                 {54333641-E5E5-4B30-A9D4-1054BFA95511}.Release|Win32.ActiveCfg = Release|Win32
                 {54333641-E5E5-4B30-A9D4-1054BFA95511}.Release|Win32.Build.0 = Release|Win32
- {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Debug|Win32.ActiveCfg = Debug|Win32
- {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Debug|Win32.Build.0 = Debug|Win32
- {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Release|Win32.ActiveCfg = Release|Win32
- {FFF275FA-323A-4699-9D04-A5C9BDD6048B}.Release|Win32.Build.0 = Release|Win32
                 {E266C18C-F482-459C-9805-EBAF5C68E50A}.Debug|Win32.ActiveCfg = Debug|Win32
                 {E266C18C-F482-459C-9805-EBAF5C68E50A}.Debug|Win32.Build.0 = Debug|Win32
                 {E266C18C-F482-459C-9805-EBAF5C68E50A}.Release|Win32.ActiveCfg = Release|Win32
@@ -114,6 +90,18 @@
                 {8F7D1DD8-FE44-419B-BE93-6A78C708ACDA}.Debug|Win32.Build.0 = Debug|Win32
                 {8F7D1DD8-FE44-419B-BE93-6A78C708ACDA}.Release|Win32.ActiveCfg = Release|Win32
                 {8F7D1DD8-FE44-419B-BE93-6A78C708ACDA}.Release|Win32.Build.0 = Release|Win32
+ {10157442-F0A7-4D8D-8169-242F44FCF035}.Debug|Win32.ActiveCfg = Debug|Win32
+ {10157442-F0A7-4D8D-8169-242F44FCF035}.Debug|Win32.Build.0 = Debug|Win32
+ {10157442-F0A7-4D8D-8169-242F44FCF035}.Release|Win32.ActiveCfg = Release|Win32
+ {10157442-F0A7-4D8D-8169-242F44FCF035}.Release|Win32.Build.0 = Release|Win32
+ {C18D47EA-742B-4256-8D9B-A3D2A1EB6E1C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C18D47EA-742B-4256-8D9B-A3D2A1EB6E1C}.Debug|Win32.Build.0 = Debug|Win32
+ {C18D47EA-742B-4256-8D9B-A3D2A1EB6E1C}.Release|Win32.ActiveCfg = Release|Win32
+ {C18D47EA-742B-4256-8D9B-A3D2A1EB6E1C}.Release|Win32.Build.0 = Release|Win32
+ {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Debug|Win32.Build.0 = Debug|Win32
+ {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Release|Win32.ActiveCfg = Release|Win32
+ {B08A2E6D-9973-42F3-9621-90F3BD4A1721}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/Boost.CGI.suo
==============================================================================
Binary files. No diff available.

Deleted: /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,202 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="acgi_cookie_game"
- ProjectGUID="{7B825743-52B4-44DC-932F-29F4D2547F38}"
- RootNamespace="acgi_cookie_game"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/D &quot;_SCL_SECURE_NO_WARNINGS&quot;"
- Optimization="0"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="libboost_system-vc90-mt-gd-1_38.lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="libboost_system-vc90-mt-gd-1_38.lib"
- LinkIncremental="1"
- AdditionalLibraryDirectories="C:\Boost\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game\main.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>

Deleted: /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj.360-SYSTEMS.darreng.user
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj.360-SYSTEMS.darreng.user 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioUserFile
- ProjectType="Visual C++"
- Version="9.00"
- ShowAllFiles="false"
- >
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- >
- <DebugSettings
- Command="$(TargetPath)"
- WorkingDirectory=""
- CommandArguments=""
- Attach="false"
- DebuggerType="3"
- Remote="1"
- RemoteMachine="DJG"
- RemoteCommand=""
- HttpUrl=""
- PDBPath=""
- SQLDebugging=""
- Environment=""
- EnvironmentMerge="true"
- DebuggerFlavor=""
- MPIRunCommand=""
- MPIRunArguments=""
- MPIRunWorkingDirectory=""
- ApplicationCommand=""
- ApplicationArguments=""
- ShimCommand=""
- MPIAcceptMode=""
- MPIAcceptFilter=""
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- >
- <DebugSettings
- Command="$(TargetPath)"
- WorkingDirectory=""
- CommandArguments=""
- Attach="false"
- DebuggerType="3"
- Remote="1"
- RemoteMachine="DJG"
- RemoteCommand=""
- HttpUrl=""
- PDBPath=""
- SQLDebugging=""
- Environment=""
- EnvironmentMerge="true"
- DebuggerFlavor=""
- MPIRunCommand=""
- MPIRunArguments=""
- MPIRunWorkingDirectory=""
- ApplicationCommand=""
- ApplicationArguments=""
- ShimCommand=""
- MPIAcceptMode=""
- MPIAcceptFilter=""
- />
- </Configuration>
- </Configurations>
-</VisualStudioUserFile>

Copied: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/cgi_cookie_game.vcproj (from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_cookie_game/acgi_cookie_game.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_cookie_game/cgi_cookie_game.vcproj 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -2,8 +2,8 @@
 <VisualStudioProject
         ProjectType="Visual C++"
         Version="9.00"
- Name="acgi_cookie_game"
- ProjectGUID="{7B825743-52B4-44DC-932F-29F4D2547F38}"
+ Name="cgi_cookie_game"
+ ProjectGUID="{10157442-F0A7-4D8D-8169-242F44FCF035}"
         RootNamespace="acgi_cookie_game"
         Keyword="Win32Proj"
         TargetFrameworkVersion="196613"
@@ -174,28 +174,10 @@
         <References>
         </References>
         <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ <File
+ RelativePath="..\..\..\..\..\example\cgi\cookie_game\main.cpp"
>
- <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game\main.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
+ </File>
         </Files>
         <Globals>
         </Globals>

Deleted: /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,211 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="acgi_ctemplate_cookie_game"
- ProjectGUID="{AC2E336C-7C32-468C-9847-470436CF668F}"
- RootNamespace="acgi_ctemplate_cookie_game"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="libboost_system-vc90-mt-gd-1_38.lib&#x0D;&#x0A;libctemplate-debug.lib"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\style.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="libctemplate.lib&#x0D;&#x0A;libboost_system-vc90-mt-1_38.lib"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\main.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\main.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\index.html"
- >
- </File>
- <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\main.js"
- >
- </File>
- <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\style.css"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>

Copied: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game/cgi_ctemplate_cookie_game.vcproj (from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/acgi_ctemplate_cookie_game/acgi_ctemplate_cookie_game.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_ctemplate_cookie_game/cgi_ctemplate_cookie_game.vcproj 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -2,8 +2,8 @@
 <VisualStudioProject
         ProjectType="Visual C++"
         Version="9.00"
- Name="acgi_ctemplate_cookie_game"
- ProjectGUID="{AC2E336C-7C32-468C-9847-470436CF668F}"
+ Name="cgi_ctemplate_cookie_game"
+ ProjectGUID="{C18D47EA-742B-4256-8D9B-A3D2A1EB6E1C}"
         RootNamespace="acgi_ctemplate_cookie_game"
         Keyword="Win32Proj"
         TargetFrameworkVersion="196613"
@@ -88,7 +88,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\style.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\cgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\cgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\style.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\cgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
                         />
                 </Configuration>
                 <Configuration
@@ -164,7 +164,7 @@
                         />
                         <Tool
                                 Name="VCPostBuildEventTool"
- CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\main.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\acgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
+ CommandLine="copy &quot;$(TargetPath)&quot; &quot;c:\code\c++\boost.cgi\cgi-bin\$(TargetName)&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\cgi\cookie_game2\style.css&quot; &quot;c:\code\c++\boost.cgi\htdocs\css\style.css&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\cgi\cookie_game2\main.js&quot; &quot;c:\code\c++\boost.cgi\htdocs\js\main.js&quot;&#x0D;&#x0A;copy &quot;$(SolutionDir)\..\..\..\..\example\cgi\cookie_game2\index.html&quot; &quot;c:\code\c++\boost.cgi\templates\index.html&quot;&#x0D;&#x0A;"
                         />
                 </Configuration>
         </Configurations>
@@ -177,7 +177,7 @@
                         UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
                         <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\main.cpp"
+ RelativePath="..\..\..\..\..\example\cgi\cookie_game2\main.cpp"
>
                         </File>
                 </Filter>
@@ -194,15 +194,15 @@
>
                 </Filter>
                 <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\index.html"
+ RelativePath="..\..\..\..\..\example\cgi\cookie_game2\index.html"
>
                 </File>
                 <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\main.js"
+ RelativePath="..\..\..\..\..\example\cgi\cookie_game2\main.js"
>
                 </File>
                 <File
- RelativePath="..\..\..\..\..\example\acgi\cookie_game2\style.css"
+ RelativePath="..\..\..\..\..\example\cgi\cookie_game2\style.css"
>
                 </File>
         </Files>

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_echo/cgi_echo.vcproj 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -170,28 +170,10 @@
         <References>
         </References>
         <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ <File
+ RelativePath="..\..\..\..\..\example\cgi\echo\main.cpp"
>
- <File
- RelativePath="..\..\..\..\..\example\cgi\echo\main.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
+ </File>
         </Files>
         <Globals>
         </Globals>

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_file_browser/cgi_file_browser.vcproj
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_file_browser/cgi_file_browser.vcproj (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/build/msvc/9.0/Boost.CGI/cgi_file_browser/cgi_file_browser.vcproj 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -2,7 +2,7 @@
 <VisualStudioProject
         ProjectType="Visual C++"
         Version="9.00"
- Name="cgi_file_browser"
+ Name="cgi_file_browser_"
         ProjectGUID="{FFF275FA-323A-4699-9D04-A5C9BDD6048B}"
         RootNamespace="cgi_echo"
         Keyword="Win32Proj"

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game/main.cpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -1,13 +1,13 @@
 // -- main.hpp --
 //
-// Copyright (c) Darren Garvey 2007.
+// Copyright (c) Darren Garvey 2007-2009.
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 ////////////////////////////////////////////////////////////////
 //
-//[acgi_cookie_game
+//[cgi_cookie_game
 //
 // Cookie Tests
 // ------------
@@ -15,7 +15,7 @@
 // This simple example shows the user their cookies and lets them set and
 // delete them.
 //
-#include <boost/cgi/acgi.hpp>
+#include <boost/cgi/cgi.hpp>
 #include <boost/cgi/utility.hpp>
 
 // The styling information for the page.
@@ -173,7 +173,7 @@
  * the source code.
  */
 
-using namespace boost::acgi;
+using namespace boost::cgi;
 
 template<typename Response, typename MapT>
 void print_formatted_data(Response& resp, MapT& data)
@@ -202,16 +202,19 @@
 
 int main()
 {
- request req;
+ request req(parse_all);
 
   // Load up the request data
- req.load(parse_all);
+ //req.load(parse_all);
 
   response resp;
- resp<< content_type("text/plain");
+ //resp<< content_type("text/plain");
 
+ using namespace std;
+ cerr<< "Here" << endl;
   if (req.form.count("reset") && req.form["reset"] == "true")
   {
+ cerr<< "Here." << endl;
     resp<< cookie("name")
         << redirect(req, req.script_name()); // redirect them.
     return commit(req, resp);
@@ -219,12 +222,17 @@
 
   if (req.form.count("name"))
   {
+ cerr<< "Here!" << endl;
+
     if (req.form.count("del"))
       resp<< cookie(req.form["name"]);
     else
       resp<< cookie(req.form["name"], req.form["value"]);
     resp<< redirect(req, req.script_name());
- return commit(req, resp);
+ cerr<< "Committing: " << resp.str() << endl;
+ int ret = commit(req, resp);
+ cerr<< "Committed response (got: " << ret << ")." << endl;
+ return ret;
   }
 
   resp<< content_type("text/html")
@@ -276,6 +284,7 @@
          "</body>"
          "</html>";
 
+ cerr<< "Committing: " << resp.str() << endl;
   return commit(req, resp);
 }
 //]

Deleted: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/Jamfile.v2 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,64 +0,0 @@
-# Copyright (c) 2007 Darren Garvey
-#
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy
-# at http://www.boost.org/LICENSE_1_0.txt)
-
-project boost/cgi/example/acgi/cookie_game2 ;
-
-import os ;
-
-lib ctemplate ;
-#lib ctemplate : : <name>ctemplate <search>C:/Packages/ctemplate/lib ;
-
-exe acgi_cookie_game2
- :
- main.cpp
- :
- <library>ctemplate
- :
- <linkflags>-lctemplate
- ;
-
-# Our install rule (builds binaries and copies them to <location>)
-install install-exe
- :
- acgi_cookie_game2
- :
- <location>$(cgi-bin)
- ;
-
-install install-css
- :
- style.css
- :
- <location>$(htdocs)/css/
- ;
-
-install install-js
- :
- main.js
- :
- <location>$(htdocs)/js/
- ;
-
-install install-extra
- :
- index.html
- :
- <location>$(htdocs)/../templates/
- ;
-
-explicit install-exe ;
-explicit install-extra ;
-
-install install
- :
- install-exe
- install-css
- install-js
- install-extra
- ;
-
-# Only install example if you use `bjam install' or equivalent
-explicit install ;

Deleted: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/doc.qbk
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/doc.qbk 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,27 +0,0 @@
-
-[section MVC Cookie Game]
-
-This example shows the user their cookies and allows them to set and delete them. It uses Google.cTemplate to move HTML out of the program and into HTML template files, which would be easily editable by anyone familiar with HTML.
-
-If you're not familiar with the term, [@http://wikipedia.org/wiki/Model-View-Controller read up on MVC]. The additional time you'll spend learning an HTML templating library, such as Google.cTemplate, will be saved many times over when compiling your CGI app starts taking more than a few seconds!
-
-[note
- You need to download and install [@http://code.google.com/p/google-ctemplate Google's cTemplate library] and you may have to modify Jamfile.v2 to point to your compiled ctemplate library (see the `lib ctemplate ...` lines).
-]
-
-You can try a demo of the MVC Cookie Game example [@http://omnisplat.com/cgi/acgi_cookie_game2 here].
-
-[import main.cpp]
-
-[acgi_cookie_game2]
-
-[table Files used for this example:
- [[File] [Contents]]
- [[[@../../example/acgi/cookie_game2/main.cpp main.cpp]] [The C++ source.]]
- [[[@../../example/acgi/cookie_game2/style.css style.css]] [CSS styling for the response.]]
- [[[@../../example/acgi/cookie_game2/main.js main.js]] [Javascript functions (for changing between GET and POST requests.]]
- [[[@../../example/acgi/cookie_game2/index.html index.html]] [The HTML template itself.]]
-]
-
-[endsect][/ echo]
-

Deleted: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/index.html
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/index.html 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,47 +0,0 @@
-
-
-<html>
-<head>
- <title>aCGI Cookie Game Example (using Google cTemplate)</title>
- <link rel="stylesheet" type="text/css" href="/css/style.css" />
- <script type="text/javascript" src="/js/main.js"></script>
-</head>
-<body>
-
-{{#HAS_NAME_IN_COOKIE_true}}
- <h1>Hello again {{USER_NAME}}</h1>
- <p></p>
-{{/HAS_NAME_IN_COOKIE_true}}
-{{#HAS_NAME_IN_COOKIE_false}}
- <h1>Hello there.</h1>
-{{/HAS_NAME_IN_COOKIE_false}}
-
-<p>You can add cookies using the form below. If you add a cookie value for 'name', it will show up above.</p>
-<p>Here is list of the cookies you currently have:</p>
-
-
-{{#DATA_MAP}}
- {{#ERROR}}
- EMPTY
- {{/ERROR}}
- <ul class="nvpair">
- {{#ROW}}
- <li class="name">{{NAME}}</li><li class="value">{{VALUE}}</li>
- {{/ROW}}
- <div class="clear"></div>
- </ul>
-{{/DATA_MAP}}
-
- <form method="get" action="{{SCRIPT_NAME}}" id="getform">
- <label for="name" class="name">Name:</label>
- <input id="name" name="name" class="value" type="text" value=" {{COOKIE_NAME}}"></input>
- <label for="value" class="name">Value:</label>
- <input id="value" name="value" class="value" type="text" value=" {{COOKIE_VALUE}}"></input>
- <label for="del" class="name">Delete this cookie?</label>
- <input id="del" name="del" class="value" type="checkbox"></input>
- <div class="clear"></div>
- <input type="submit"></input>
- </form>
- <input type="submit" onclick="switch_method('getform'); switch_value(this); return false;" value="Switch to POST"></input>
-</body>
-</html>
\ No newline at end of file

Deleted: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,171 +0,0 @@
-// -- main.hpp --
-//
-// Copyright (c) Darren Garvey 2007.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-//////////////////////////////////////////////////////////////////
-//[acgi_cookie_game2
-//
-// Cookie Test With cTemplate
-// --------------------------
-//
-// This file uses Google cTemplate [1] to show the benefits of using an HTML
-// template engine. Using cTemplate to separate how you show the response and
-// how you figure out what to respond with, is keeping to the MVC paradigm.
-// Read up on that if you're not familiar; if you already are, you can
-// probably stop scowling at the last cookie_game example now.
-//
-// [1] - http://code.google.com/p/google-ctemplate/
-//
-#include <boost/cgi/acgi.hpp>
-#include <boost/cgi/utility.hpp>
-#include <ctemplate/template.h>
-#include <boost/throw_exception.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/filesystem.hpp>
-//]
-
-/**
- * The following example has a few stages.
- * It is best understood by compiling and testing it, and then looking at
- * the source code.
- */
-
-//[main
-
-using namespace boost::acgi;
-namespace fs = boost::filesystem;
-
-// The types we use. Only here because this is an example.
-
-// Uses cTemplate, from Google. It's simple and powerful.
-typedef ctemplate::Template stencil_type;
-// You will usually load a template and then populate variables in it
-// using a TemplateDictionary.
-typedef ctemplate::TemplateDictionary dictionary_type;
-// The acgi and fcgi parts of the CGI library use a `service` class to
-// manage asynchronous dispatching (eg. async I/O). If you're not interested
-// in async I/O, you can just use the plain cgi stuff (which is the same as
-// acgi, but without the *a*sync bits).
-// If you're unsure, you can use acgi without having to really do anything with
-// the service - it's only used on two lines in this example. In one of them
-// it is constructed...
-typedef service service_type;
-// ... and on the other it's used to construct the `request`.
-typedef request request_type;
-// The `response` will make your life easier (and more efficient).
-typedef response response_type;
-
-// These are some of the functions / types / enums used in this example.
-using boost::acgi::cookie;
-using boost::acgi::header;
-using boost::acgi::redirect;
-using boost::acgi::parse_all;
-using boost::acgi::content_type;
-
-// This function just makes it easier to change the templating engine. It's
-// only here to keep the cTemplate code out of the core of this example...
-stencil_type* get_stencil(std::string const& filename)
-{
- if (!fs::exists(filename))
- throw std::runtime_error(
- std::string("Template file not found: '")
- + fs::path(filename).string() + "'");
- else
- return ctemplate::Template::GetTemplate(
- filename, ctemplate::STRIP_WHITESPACE);
-}
-
-// Show the data in the passed map, updating the passed dictionary.
-template<typename MapT, typename Dict>
-void print_formatted_data(MapT& data, Dict& dict)
-{
- Dict* subd = dict.AddSectionDictionary("DATA_MAP");
- if (data.empty())
- subd->ShowSection("EMPTY");
- else
- for(typename MapT::const_iterator iter=data.begin(), end = data.end(); iter != end; ++iter)
- {
- Dict* row_dict = subd->AddSectionDictionary("ROW");
- row_dict->SetValue("NAME", iter->first.c_str());
- row_dict->SetValue("VALUE", iter->second);
- row_dict->ShowSection("ROW");
- }
-}
-
-
-int main()
-{
- try {
- request_type req;
-
- // Load up the request data
- req.load(parse_all);
-
- response_type resp;
-
- // Check if we are resetting the user.
- if (req.form.count("reset") && req.form["reset"] == "true")
- {
- resp<< cookie("name") // delete the 'name' cookie.
- << redirect(req, req.script_name()); // redirect them.
- resp.send(req.client());
- return 0;
- }
-
- if (req.form.count("name"))
- {
- // If requested by the user, delete the cookie.
- if (req.form.count("del"))
- resp<< cookie(req.form["name"]);
- else // Set the cookie.
- resp<< cookie(req.form["name"], req.form["value"]);
- resp<< redirect(req, req.script_name());
- // Exit here.
- return commit(req, resp, http::ok);
- }
-
- dictionary_type dict("cookie-game dict");
-
- // First, see if they have a cookie set
- if (req.cookies.count("name"))
- dict.SetValueAndShowSection("USER_NAME", req.cookies["name"],
- "HAS_NAME_IN_COOKIE_true");
- else
- dict.ShowSection("HAS_NAME_IN_COOKIE_false");
-
- print_formatted_data(req.cookies, dict);
-
- dict.SetValue("SCRIPT_NAME", req.script_name());
- // get_value is defined in boost/cgi/util/
- // Looks up the key in the map, returns a default value if the key
- // isn't found.
- dict.SetValue("COOKIE_NAME", req.form.get("name", ""));
- dict.SetValue("COOKIE_VALUE", req.form["value"]);
-
- // Load the HTML stencil now from the index.html file.
- stencil_type* stencil = get_stencil("../templates/index.html");
-
- // Expand the stencil with the the given dictionary into `output`.
- std::string output;
- stencil->Expand(&output, &dict);
-
- // Add the template to the response.
- resp<< content_type("text/html")
- << output;
-
- // Send the response to the requestor and return control.
- return commit(req, resp, http::ok);
-
- }catch(boost::system::system_error& err){
- std::cerr<< "System Error: [" << err.code() << "] - " << err.what() << std::endl;
- }catch(std::exception const& e){
- std::cerr<< "Exception: [" << typeid(e).name() << "] - " << e.what() << std::endl;
- }catch(...){
- std::cerr<< "boom<blink>!</blink>";
- }
-}
-//]
-

Deleted: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.js
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.js 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,30 +0,0 @@
-function switch_method(ident) {
- var f = document.getElementById(ident);
- if (f.method == 'post') f.method = 'GET';
- else f.method = 'POST';
-}
-function switch_value(elem) {
- if (elem.value == 'Switch to POST') {
- elem.value = 'Switch to GET';
- }else{
- elem.value = 'Switch to POST';
- }
-}
-function switch_form(elem) {
- var g = document.getElementById('getform');
- var p = document.getElementById('postform');
- if (elem.value == 'Switch to POST') {
- p.style.visibility = 'visible';
- p.style.display = 'block';
- g.style.visibility = 'hidden';
- g.style.display = 'none';
- elem.value = 'Switch to GET';
- } else {
- g.style.visibility = 'visible';
- g.style.display = 'block';
- p.style.visibility = 'hidden';
- p.style.display = 'none';
- elem.value = 'Switch to POST';
- }
-}
-

Deleted: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/style.css
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/style.css 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
+++ (empty file)
@@ -1,112 +0,0 @@
-body { padding: 0; margin: 3%; border-color: #efe; }
-.var_map_title
- { font-weight: bold; font-size: large; }
-.var_map
- { border: 1px dotted; padding: 2px 3px 2px 3px; margin-bottom: 3%; }
-.pair
- { border-top: 1px dotted; overflow: auto; padding: 0; margin: 0; }
-/*
-.name
- { position: relative; float: left; width: 30%; font-weight: bold; }
-.value
- { position: relative; float: left; width: 65%; left: 1%;
- border-left: 1px solid; padding: 0 5px 0 5px;
- overflow: auto; white-space: pre; }
-*/
-.info
-{
- border-color: #ca3766;
- border-width: 1px 0 1px 0;
- border-style: solid;
- padding: 2px 8px 2px 8px;
- margin: 1em
-}
-#response
-{
- text-align: center;
- padding: 20px 30px 20px 30px;
- margin: 1em;
- border-width: 2px 0 2px 0;
- border-style: solid;
- border-color: #ca3766;
-}
-.var_map_title
-{
- font-weight: bold;
- font-size: large;
-}
-.var_map
-{
- border: 1px dotted;
- padding: 2px 3px 2px 3px;
- margin: 15px 0 15px 0;
-}
-.var_pair
-{
- border-top: 1px dotted;
- overflow: auto;
- padding: 0;
- margin: 0;
-}
-.var_name
-{
- position: relative;
- float: left;
- width: 30%;
- font-weight: bold;
-}
-.var_value
-{
- position: relative;
- float: left;
- width: 65%;
- left: 1%;
- border-left: 1px solid;
- padding: 0 5px 0 5px;
- overflow: auto;
- white-space: pre;
-}
-.nvpair
-{
- list-style-type: none;
-}
-form
-{
-}
-input
-{
-border-width: 0 0 1px 0;
-border-style: solid;
-border-color: #444;
-padding: 2px 3px 2px 3px;
-margin-left: 1em;
-background: #FaFbFd;
-}
-input[type=submit]
-{
- margin-left: 35%;
-}
-.name, .value
-{
- display: inline;
- width: 20%;
- float: left;
-}
-.name
-{
- text-align: right;
- padding-right: 1em;
- clear: left;
-}
-.value
-{
- text-align: left;
- padding-left: 1em;
-}
-.clear { clear: both; }
-.cookies { margin: 10px 0 25px 0; }
-#postform
-{
- visibility: hidden;
- display: none;
-}

Copied: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/index.html (from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/index.html)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/index.html (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/index.html 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -16,9 +16,7 @@
     <h1>Hello there.</h1>
 {{/HAS_NAME_IN_COOKIE_false}}
 
-<p>You can add cookies using the form below. If you add a cookie value for 'name', it will show up above.</p>
-<p>Here is list of the cookies you currently have:</p>
-
+<p>Here is list of the cookies you currently have for this site:</p>
 
 {{#DATA_MAP}}
     {{#ERROR}}
@@ -26,12 +24,20 @@
     {{/ERROR}}
     <ul class="nvpair">
     {{#ROW}}
- <li class="name">{{NAME}}</li><li class="value">{{VALUE}}</li>
+ <li class="name">{{NAME}}</li>
+ <li class="value">{{VALUE}}
+ Remove
+ </li>
     {{/ROW}}
         <div class="clear"></div>
     </ul>
 {{/DATA_MAP}}
 
+<p>
+ You can add cookies using the form below.
+ If you add a cookie value for 'name', it will show up above.
+</p>
+
     <form method="get" action="{{SCRIPT_NAME}}" id="getform">
         <label for="name" class="name">Name:</label>
         <input id="name" name="name" class="value" type="text" value=" {{COOKIE_NAME}}"></input>

Copied: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/main.cpp (from r57598, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/main.cpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -1,12 +1,12 @@
 // -- main.hpp --
 //
-// Copyright (c) Darren Garvey 2007.
+// Copyright (c) Darren Garvey 2007-2009.
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 //////////////////////////////////////////////////////////////////
-//[acgi_cookie_game2
+//[cgi_cookie_game2
 //
 // Cookie Test With cTemplate
 // --------------------------
@@ -19,7 +19,7 @@
 //
 // [1] - http://code.google.com/p/google-ctemplate/
 //
-#include <boost/cgi/acgi.hpp>
+#include <boost/cgi/cgi.hpp>
 #include <boost/cgi/utility.hpp>
 #include <ctemplate/template.h>
 #include <boost/throw_exception.hpp>
@@ -35,7 +35,7 @@
 
 //[main
 
-using namespace boost::acgi;
+using namespace boost::cgi;
 namespace fs = boost::filesystem;
 
 // The types we use. Only here because this is an example.
@@ -59,11 +59,11 @@
 typedef response response_type;
 
 // These are some of the functions / types / enums used in this example.
-using boost::acgi::cookie;
-using boost::acgi::header;
-using boost::acgi::redirect;
-using boost::acgi::parse_all;
-using boost::acgi::content_type;
+using boost::cgi::cookie;
+using boost::cgi::header;
+using boost::cgi::redirect;
+using boost::cgi::parse_all;
+using boost::cgi::content_type;
 
 // This function just makes it easier to change the templating engine. It's
 // only here to keep the cTemplate code out of the core of this example...

Copied: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/style.css (from r56355, /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/style.css)
==============================================================================
--- /sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/acgi/cookie_game2/style.css (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/cookie_game2/style.css 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -70,6 +70,10 @@
 {
     list-style-type: none;
 }
+.nvpair a
+{
+ float: right;
+}
 form
 {
 }

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/echo/main.cpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -1,6 +1,6 @@
-// -- main.hpp --
+// -- main.hpp --
 //
-// Copyright (c) Darren Garvey 2007.
+// Copyright (c) Darren Garvey 2007-2009.
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/cgi/cgi.hpp>
 
-using namespace boost::cgi;
+namespace cgi = boost::cgi;
 
 // The styling information for the page, just to make things look nicer.
 static const char* gCSS_text =
@@ -25,7 +25,7 @@
 ".var_map_title"
     "{ font-weight: bold; font-size: large; }"
 ".var_map"
- "{ border: 1px dotted; padding: 2px 3px 2px 3px; margin-bottom: 3%; }"
+ "{ border: 1px dotted; padding: 2px 3px; margin-bottom: 3%; }"
 ".var_pair"
     "{ border-top: 1px dotted; overflow: auto; padding: 0; margin: 0; }"
 ".var_name"
@@ -40,6 +40,10 @@
 // This function writes the title and map contents to the ostream in an
 // HTML-encoded format (to make them easier on the eye).
 //
+// The request data is all held in std::map<>-like containers and can use the same
+// member functions. There are some additional functions included for common
+// CGI tasks, such as lexical casting.
+//
 template<typename OStream, typename Request, typename Map>
 void format_map(OStream& os, Request& req, Map& m, const std::string& title)
 {
@@ -51,36 +55,29 @@
   if (m.empty())
     os<< "<div class=\"var_pair\">EMPTY</div>";
   else
- for (typename Map::const_iterator i = m.begin(); i != m.end(); ++i)
+ {
+ for (typename Map::const_iterator iter(m.begin()), end(m.end());
+ iter != m.end();
+ ++iter)
     {
       os<< "<div class=\"var_pair\">"
              "<div class=\"var_name\">"
- << i->first
+ << iter->first
         << "</div>"
              "<div class=\"var_value\">"
- << i->second
- << (req.is_file(i->first) ? " (file)" : "")
+ << iter->second
+ << (req.is_file(iter->first) ? " (file)" : "")
         << "</div>"
            "</div>";
     }
   os<< "</div>";
 }
 
-std::size_t process_id()
-{
-#if defined(BOOST_WINDOWS)
- return _getpid();
-#else
- return getpid();
-#endif
-}
-
-
 int main()
 {
   // A basic CGI request auto-parses everything (including POST data).
- request req(parse_all);
- response resp;
+ cgi::request req;
+ cgi::response resp;
 
   // You can also stream text to a response.
   // All of this just prints out the form
@@ -93,7 +90,6 @@
          "<head>"
          "<body>"
            "Request ID = " << req.id() << "<br />"
- "Process ID = " << process_id() << "<br />"
            "<form method=post enctype=\"multipart/form-data\">"
              "<input type=text name=name value='"
       << req.post["name"] << "' />"
@@ -109,15 +105,15 @@
 
   format_map(resp, req, req.env, "Environment Variables");
   //format_map(resp, req, req.get, "GET Variables");
- format_map(resp, req, req.form, "Form [" + req.request_method() + "] Variables");
+ format_map(resp, req, req.form, "Form [" + req.method() + "] Variables");
   format_map(resp, req, req.cookies, "Cookie Variables");
 
   // Note that this (and any other) HTTP header can go either before or after
   // the response contents.
- resp<< content_type("text/html");
+ resp<< cgi::content_type("text/html");
 
   // Send the response to the client that made the request.
- return commit(req, resp);
+ return cgi::commit(req, resp);
 }
 //]
 

Modified: sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/hello_world/main.cpp
==============================================================================
--- sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/hello_world/main.cpp (original)
+++ sandbox/SOC/2007/cgi/branches/pickmeup/libs/cgi/example/cgi/hello_world/main.cpp 2009-12-14 17:38:21 EST (Mon, 14 Dec 2009)
@@ -9,28 +9,45 @@
 //
 //[cgi_hello_world
 //
-// The simplest CGI program, outputs only "Hello there, universe."
+// A simple CGI program.
 //
-// If you think this is a pointless example, try getting it to work;
-// It doesn't always go to plan... ;)
+// Outputs only "Hello there, universe." and saves a session cookie "test=check" to the browser.
 //
 
 #include <boost/cgi/cgi.hpp>
 
-using namespace boost::cgi;
+namespace cgi = boost::cgi;
 
 int main()
 {
- request req; // Our request (POST data won't be parsed yet).
- response resp; // A response object to make our lives easier.
-
- // This is a minimal response. The content_type(...) may go before or after
+try {
+ // Construct a request. Parses all GET, POST and environment data,
+ // as well as cookies.
+ cgi::request req(cgi::parse_all);
+ // Using a response is the simplest way to write data back to the client.
+ cgi::response resp;
+
+ // This is a minimal response. The cgi::cookie(...) may go before or after
   // the response text.
- resp<< content_type("text/plain")
- << "Hello there, universe.";
+ resp<< "Hello there, universe."
+ << cgi::cookie("test", "check")
+ ;
 
   // Leave this function, after sending the response and closing the request.
- return commit(req, resp);
+ // Returns 0 on success.
+ return cgi::commit(req, resp);
+
+} catch(std::exception& e) {
+ using namespace std;
+ cout<< "Content-type: text/plain\r\n\r\n"
+ << "Error: " << e.what() << endl;
+ return 1;
+} catch(...) {
+ using namespace std;
+ cout<< "Content-type: text/plain\r\n\r\n"
+ << "Unexpected exception." << endl;
+ return 1;
+}
 }
 //]
 


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