1 #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PROTOCOL_HPP_20100619
2 #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PROTOCOL_HPP_20100619
3 
4 // Copyright 2010 (c) Dean Michael Berris.
5 // Copyright 2010 (c) Sinefunc, Inc.
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9 
10 namespace boost {
11 namespace network {
12 namespace http {
13 
14 template <class Tag>
15 struct basic_request;
16 
17 namespace impl {
18 template <class Tag>
19 struct protocol_wrapper {
20   basic_request<Tag> const& message_;
protocol_wrapperboost::network::http::impl::protocol_wrapper21   explicit protocol_wrapper(basic_request<Tag> const& message) : message_(message) {}
22   typedef typename basic_request<Tag>::string_type string_type;
operator string_typeboost::network::http::impl::protocol_wrapper23   operator string_type() { return message_.protocol(); }
24 };
25 } // namespace impl
26 
27 template <class Tag>
protocol(basic_request<Tag> const & request)28 inline impl::protocol_wrapper<Tag> protocol(basic_request<Tag> const& request) {
29   return impl::protocol_wrapper<Tag>(request);
30 }
31 
32 }  // namespace http
33 
34 }  // namespace network
35 
36 }  // namespace boost
37 
38 #endif  // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PROTOCOL_HPP_20100619
39