File tree Expand file tree Collapse file tree 12 files changed +182
-1
lines changed
protocol/http/message/wrappers Expand file tree Collapse file tree 12 files changed +182
-1
lines changed Original file line number Diff line number Diff line change 7
7
// (See accompanying file LICENSE_1_0.txt or copy at
8
8
// http://www.boost.org/LICENSE_1_0.txt)
9
9
10
+ #include < boost/network/constants.hpp>
11
+
10
12
namespace boost { namespace network {
11
13
12
14
char const * constants::crlf () {
Original file line number Diff line number Diff line change
1
+ #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_ANCHOR_IPP_20111204
2
+ #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_ANCHOR_IPP_20111204
3
+
4
+ // Copyright 2011 Dean Michael Berris <dberris@google.com>.
5
+ // Copyright 2011 Googl,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
+ #include < boost/network/protocol/http/message/wrappers/anchor.hpp>
11
+ #include < boost/network/uri/uri.hpp>
12
+
13
+ namespace boost { namespace network { namespace http {
14
+
15
+ anchor_wrapper::anchor_wrapper (request_base const & request)
16
+ : request_(request) {}
17
+
18
+ anchor_wrapper::operator std::string () const {
19
+ uri::uri uri_;
20
+ request_.get_uri (uri_);
21
+ return fragment (uri_);
22
+ }
23
+
24
+ } // namespace http
25
+
26
+ } // namespace network
27
+
28
+ } // namespace boost
29
+
30
+ #endif // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_ANCHOR_IPP_20111204
Original file line number Diff line number Diff line change
1
+ #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_IPP_20111204
2
+ #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_IPP_20111204
3
+
4
+ // Copyright 2011 Dean Michael Berris <dberris@google.com>.
5
+ // Copyright 2011 Google, 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
+ #include < boost/network/protocol/http/message/wrappers/host.hpp>
11
+ #include < boost/network/uri/uri.hpp>
12
+
13
+ namespace boost { namespace network { namespace http {
14
+
15
+ host_wrapper::host_wrapper (request_base const & request)
16
+ : request_(request) {}
17
+
18
+ host_wrapper::operator std::string () const {
19
+ uri::uri uri_;
20
+ request_.get_uri (uri_);
21
+ return host (uri_);
22
+ }
23
+
24
+ } // namespace http
25
+
26
+ } // namespace network
27
+
28
+ } // namespace boost
29
+
30
+ #endif // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_IPP_20111204
Original file line number Diff line number Diff line change
1
+ #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PATH_IPP_20111204
2
+ #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PATH_IPP_20111204
3
+
4
+ // Copyright 2011 Dean Michael Berris <dberris@google.com>.
5
+ // Copyright 2011 Google, 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
+ #include < boost/network/protocol/http/message/wrappers/path.hpp>
11
+ #include < boost/network/uri/uri.hpp>
12
+
13
+ namespace boost { namespace network { namespace http {
14
+
15
+ path_wrapper::path_wrapper (request_base const & request)
16
+ : request_(request) {}
17
+
18
+ path_wrapper::operator std::string () const {
19
+ uri::uri uri_;
20
+ request_.get_uri (uri_);
21
+ return path (uri_);
22
+ }
23
+
24
+ } // namespace http
25
+
26
+ } // namespace network
27
+
28
+ } // namespace boost
29
+
30
+ #endif // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PATH_IPP_20111204
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ struct port_wrapper {
18
18
operator boost::uint16_t () const ;
19
19
operator boost::optional<boost::uint16_t > () const ;
20
20
private:
21
- request_base const & message_ ;
21
+ request_base const & request_ ;
22
22
};
23
23
24
24
inline port_wrapper const
Original file line number Diff line number Diff line change
1
+ #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PORT_IPP_20111204
2
+ #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PORT_IPP_20111204
3
+
4
+ // Copyright 2011 Dean Michael Berris <dberris@google.com>.
5
+ // Copyright 2011 Google, 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
+ #include < boost/network/protocol/http/message/wrappers/port.hpp>
11
+ #include < boost/network/uri/uri.hpp>
12
+
13
+ namespace boost { namespace network { namespace http {
14
+
15
+ port_wrapper::port_wrapper (request_base const & request)
16
+ : request_(request) {}
17
+
18
+ port_wrapper::operator boost::uint16_t () const {
19
+ uri::uri uri_;
20
+ request_.get_uri (uri_);
21
+ optional<boost::uint16_t > optional_port = port_us (uri_);
22
+ return optional_port ? *optional_port : 80u ;
23
+ }
24
+
25
+ port_wrapper::operator optional<boost::uint16_t > () const {
26
+ uri::uri uri_;
27
+ request_.get_uri (uri_);
28
+ return port_us (uri_);
29
+ }
30
+
31
+ } // namespace http
32
+
33
+ } // namespace network
34
+
35
+ } // namespace boost
36
+
37
+ #endif // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PORT_IPP_20111204
Original file line number Diff line number Diff line change
1
+ #ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_QUERY_IPP_20111204
2
+ #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_QUERY_IPP_20111204
3
+
4
+ // Copyright 2011 Dean Michael Berris <dberris@google.com>.
5
+ // Copyright 2011 Google, 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
+ #include < boost/network/protocol/http/message/wrappers/query.hpp>
11
+ #include < boost/network/uri/uri.hpp>
12
+
13
+ namespace boost { namespace network { namespace http {
14
+
15
+ query_wrapper::query_wrapper (request_base const & request)
16
+ : request_(request) {}
17
+
18
+ query_wrapper::operator std::string () const {
19
+ uri::uri uri_;
20
+ request_.get_uri (uri_);
21
+ return query (uri_);
22
+ }
23
+
24
+ } // namespace http
25
+
26
+ } // namespace network
27
+
28
+ } // namespace boost
29
+
30
+ #endif // BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_QUERY_IPP_20111204
Original file line number Diff line number Diff line change @@ -47,3 +47,6 @@ add_library(cppnetlib-http-client ${CPP-NETLIB_HTTP_CLIENT_SRCS})
47
47
48
48
set (CPP-NETLIB_UTILS_THREAD_POOL_SRCS utils/thread_pool.cpp )
49
49
add_library (cppnetlib-utils-thread_pool ${CPP-NETLIB_UTILS_THREAD_POOL_SRCS} )
50
+
51
+ set (CPP-NETLIB_CONSTANTS_SRCS constants.cpp )
52
+ add_library (cppnetlib-constants ${CPP-NETLIB_CONSTANTS_SRCS} )
Original file line number Diff line number Diff line change
1
+ // Copyright 2011 Dean Michael Berris <dberris@google.com>.
2
+ // Copyright 2011 Google, Inc.
3
+ // Distributed under the Boost Software License, Version 1.0.
4
+ // (See accompanying file LICENSE_1_0.txt or copy at
5
+ // http://www.boost.org/LICENSE_1_0.txt)
6
+
7
+ #ifdef BOOST_NETWORK_NO_LIB
8
+ #undef BOOST_NETWORK_NO_LIB
9
+ #endif
10
+
11
+ #include < boost/network/constants.ipp>
Original file line number Diff line number Diff line change 10
10
11
11
#include < boost/network/protocol/http/client/connection_manager.ipp>
12
12
#include < boost/network/protocol/http/client/client_connection.ipp>
13
+ #include < boost/network/protocol/http/impl/access.ipp>
You can’t perform that action at this time.
0 commit comments