Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7f25109

Browse files
committed
Merge branch '0.7-devel' of git://github.com/mikhailberis/cpp-netlib into 0.7-devel
2 parentsc3f9780 +534f964 commit7f25109

File tree

14 files changed

+497
-21
lines changed

14 files changed

+497
-21
lines changed

‎boost/network/protocol/http/impl/request.hpp‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright Dean Michael Berris 2007,2009.
2+
// Copyright Dean Michael Berris 2007,2009,2010.
33
// Copyright Michael Dickey 2008.
44
// Distributed under the Boost Software License, Version 1.0.
55
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -18,6 +18,8 @@
1818
#include<boost/network/protocol/http/header.hpp>
1919
#include<boost/network/traits/vector.hpp>
2020

21+
#include<boost/cstdint.hpp>
22+
2123
namespaceboost {namespacenetwork {namespacehttp {
2224

2325
/** request.hpp
@@ -31,11 +33,12 @@ namespace boost { namespace network { namespace http {
3133
classbasic_request :publicbasic_message<Tag>
3234
{
3335

34-
boost::network::uri::http::uri uri_;
36+
mutableboost::network::uri::http::uri uri_;
3537

3638
public:
3739
typedef Tag tag;
3840
typedeftypename string<Tag>::type string_type;
41+
typedef boost::uint16_t port_type;
3942

4043
explicitbasic_request(string_typeconst & uri_)
4144
: uri_(uri_)
@@ -70,7 +73,7 @@ namespace boost { namespace network { namespace http {
7073
return uri_.host();
7174
}
7275

73-
unsignedintport()const {
76+
port_typeport()const {
7477
return uri_.port();
7578
}
7679

@@ -90,6 +93,10 @@ namespace boost { namespace network { namespace http {
9093
return uri_.scheme();
9194
}
9295

96+
voiduri(string_typeconst & new_uri)const {
97+
uri_ = new_uri;
98+
}
99+
93100
};
94101

95102
/** This is the implementation of a POD request type
@@ -104,6 +111,7 @@ namespace boost { namespace network { namespace http {
104111
typedef tags::http_server tag;
105112
typedef string<tags::http_server>::type string_type;
106113
typedef vector<tags::http_server>::apply<request_header>::type vector_type;
114+
typedef boost::uint16_t port_type;
107115
string_type method;
108116
string_type uri;
109117
boost::uint8_t http_version_major;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_DIRECTIVES_URI_HPP_20100620
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_DIRECTIVES_URI_HPP_20100620
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+
#include<boost/network/tags.hpp>
11+
12+
namespaceboost {namespacenetwork {namespacehttp {
13+
14+
template<classTag>
15+
classbasic_request;
16+
17+
template<classTag>
18+
structuri_directive {
19+
20+
typedeftypename string<Tag>::type string_type;
21+
22+
mutable string_type uri_;
23+
24+
uri_directive(string_typeconst & uri)
25+
: uri_(uri) {}
26+
27+
uri_directive(uri_directiveconst & other)
28+
: uri(other.uri_) {}
29+
30+
template<classT> basic_request<T>const &operator() (basic_request<T>const & request)const {
31+
request.uri(uri_);
32+
return request;
33+
}
34+
35+
};
36+
37+
inline uri_directive<tags::default_>consturi(string<tags::default_>::typeconst & uri_) {
38+
return uri_directive<tags::default_>(uri_);
39+
}
40+
41+
}// namespace http
42+
43+
}// namespace network
44+
45+
}// namespace boost
46+
47+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_DIRECTIVES_URI_HPP_20100620
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_URI_HPP_20100621
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_URI_HPP_20100621
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+
#include<boost/network/support/is_async.hpp>
11+
#include<boost/thread/future.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
classbasic_request;
17+
18+
namespaceimpl {
19+
20+
template<classTag,classT>
21+
voiduri(basic_request<Tag> & response, Tconst & value, mpl::false_const &) {
22+
response <<boost::network::http::uri(value);
23+
}
24+
25+
template<classTag,classT>
26+
voiduri(basic_request<Tag> & response, boost::shared_future<T> future, mpl::true_const &) {
27+
response.uri() = future;
28+
}
29+
30+
}// namespace impl
31+
32+
template<classTag,classT>
33+
voiduri(basic_request<Tag> & response, Tconst & value) {
34+
impl::uri(response, value, is_async<Tag>());
35+
}
36+
37+
}// namespace http
38+
39+
}// namespace network
40+
41+
}// namespace boost
42+
43+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_URI_HPP_20100621
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_ANCHOR_HPP_20100618
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_ANCHOR_HPP_20100618
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+
#include<boost/network/protocol/http/request_concept.hpp>
11+
#include<boost/concept/requires.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
classbasic_request;
17+
18+
namespaceimpl {
19+
template<classTag>
20+
structanchor_wrapper {
21+
basic_request<Tag>const & message_;
22+
anchor_wrapper(basic_request<Tag>const & message)
23+
: message_(message) {}
24+
typedeftypename basic_request<Tag>::string_type string_type;
25+
operatorstring_type() {
26+
return message_.anchor();
27+
}
28+
};
29+
}
30+
31+
template<classTag>inline
32+
BOOST_CONCEPT_REQUIRES(((Request<basic_request<Tag> >)),
33+
(impl::anchor_wrapper<Tag>))
34+
anchor(basic_request<Tag>const & request) {
35+
return impl::anchor_wrapper<Tag>(request);
36+
}
37+
38+
}// namespace http
39+
40+
}// namespace network
41+
42+
}// nmaespace boost
43+
44+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_ANCHOR_HPP_20100618
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_HOST_HPP_20100618
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_HOST_HPP_20100618
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+
#include<boost/network/protocol/http/request_concept.hpp>
11+
#include<boost/concept/requires.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
classbasic_request;
17+
18+
namespaceimpl {
19+
20+
template<classTag>
21+
structhost_wrapper {
22+
basic_request<Tag>const & message_;
23+
24+
host_wrapper(basic_request<Tag>const & message)
25+
: message_(message) {}
26+
27+
typedeftypename basic_request<Tag>::string_type string_type;
28+
29+
operatorstring_type() {
30+
return message_.host();
31+
}
32+
};
33+
34+
}
35+
36+
template<classTag>
37+
inline
38+
BOOST_CONCEPT_REQUIRES(((Request<basic_request<Tag> >)),
39+
(impl::host_wrapper<Tag>))
40+
host(basic_request<Tag>const & request) {
41+
return impl::host_wrapper<Tag>(request);
42+
}
43+
44+
}// namespace http
45+
46+
}// namespace network
47+
48+
}// namespace boost
49+
50+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_HOST_HPP_20100618
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_PATH_HPP_20100618
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_PATH_HPP_20100618
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+
#include<boost/network/protocol/http/request_concept.hpp>
11+
#include<boost/concept/requires.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
classbasic_request;
17+
18+
namespaceimpl {
19+
20+
template<classTag>
21+
structpath_wrapper {
22+
basic_request<Tag>const & message_;
23+
24+
path_wrapper(basic_request<Tag>const & message)
25+
: message_(message) {}
26+
27+
typedeftypename basic_request<Tag>::string_type string_type;
28+
29+
operatorstring_type() {
30+
return message_.path();
31+
}
32+
};
33+
34+
}
35+
36+
template<classTag>
37+
inline
38+
BOOST_CONCEPT_REQUIRES(((Request<basic_request<Tag> >)),
39+
(impl::path_wrapper<Tag>))
40+
path(basic_request<Tag>const & request) {
41+
return impl::path_wrapper<Tag>(request);
42+
}
43+
44+
}// namespace http
45+
46+
}// namespace network
47+
48+
}// namespace boost
49+
50+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_PATH_HPP_20100618
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_PORT_HPP_20100618
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_PORT_HPP_20100618
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+
#include<boost/network/protocol/http/request_concept.hpp>
11+
#include<boost/concept/requires.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
classbasic_request;
17+
18+
namespaceimpl {
19+
20+
template<classTag>
21+
structport_wrapper {
22+
basic_request<Tag>const & message_;
23+
24+
port_wrapper(basic_request<Tag>const & message)
25+
: message_(message) {}
26+
27+
typedeftypename basic_request<Tag>::port_type port_type;
28+
29+
operatorport_type() {
30+
return message_.port();
31+
}
32+
};
33+
34+
}// namespace impl
35+
36+
template<classTag>
37+
inline
38+
BOOST_CONCEPT_REQUIRES(((Request<basic_request<Tag> >)),
39+
(impl::port_wrapper<Tag>))
40+
port(basic_request<Tag>const & request) {
41+
return impl::port_wrapper<Tag>(request);
42+
}
43+
44+
}// namespace http
45+
46+
}// namespace network
47+
48+
}// namespace boost
49+
50+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_PORT_HPP_20100618
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PROTOCOL_HPP_20100619
2+
#defineBOOST_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+
#include<boost/network/protocol/http/request_concept.hpp>
11+
#include<boost/concept/requires.hpp>
12+
13+
namespaceboost {namespacenetwork {namespacehttp {
14+
15+
template<classTag>
16+
classbasic_request;
17+
18+
namespaceimpl {
19+
template<classTag>
20+
structprotocol_wrapper {
21+
basic_request<Tag>const & message_;
22+
protocol_wrapper(basic_request<Tag>const & message)
23+
: message_(message) {}
24+
typedeftypename basic_request<Tag>::string_type string_type;
25+
operatorstring_type() {
26+
return message_.protocol();
27+
}
28+
};
29+
}
30+
31+
template<classTag>inline
32+
BOOST_CONCEPT_REQUIRES(((Request<basic_request<Tag> >)),
33+
(impl::protocol_wrapper<Tag>))
34+
protocol(basic_request<Tag>const & request) {
35+
return impl::protocol_wrapper<Tag>(request);
36+
}
37+
38+
}// namespace http
39+
40+
}// namespace network
41+
42+
}// namespace boost
43+
44+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_PROTOCOL_HPP_20100619

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp