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

Commite92fe04

Browse files
committed
Revert "Merge branch '0.9-devel' of github.com:deanberris/cpp-netlib into canonical-0.9-devel"
This reverts commit9ab0cac, reversingchanges made to79d3fd6.
1 parentb8c28a5 commite92fe04

36 files changed

+1540
-812
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include<boost/fusion/sequence/intrinsic/at_key.hpp>
1616
#include<boost/fusion/sequence/intrinsic/value_at_key.hpp>
1717

18-
#include<boost/network/uri/uri.hpp>
18+
#include<boost/network/uri/http/uri.hpp>
1919
#include<boost/network/traits/vector.hpp>
2020

2121
#include<boost/network/protocol/http/message/async_message.hpp>
@@ -50,7 +50,7 @@ namespace http {
5050
structbasic_request :publicbasic_message<Tag>
5151
{
5252

53-
mutable boost::network::uri::basic_uri<typename string<Tag>::type> uri_;
53+
mutable boost::network::uri::http::basic_uri<Tag> uri_;
5454
typedef basic_message<Tag> base_type;
5555

5656
public:
@@ -80,25 +80,19 @@ namespace http {
8080
}
8181

8282
voidswap(basic_request & other) {
83+
using boost::network::uri::swap;
8384
base_type &base_ref(other);
8485
basic_request<Tag> &this_ref(*this);
8586
base_ref.swap(this_ref);
86-
boost::swap(other.uri_,this->uri_);
87+
swap(other.uri_,this->uri_);
8788
}
8889

8990
string_typeconsthost()const {
9091
return uri_.host();
9192
}
9293

9394
port_typeport()const {
94-
boost::optional<port_type> port =uri::port_us(uri_);
95-
if (!port)
96-
{
97-
typedef constants<Tag> consts;
98-
returnboost::iequals(uri_.scheme_range(),
99-
string_type(consts::https()))?443 :80;
100-
}
101-
return *port;
95+
returnuri::port_us(uri_);
10296
}
10397

10498
string_typeconstpath()const {
@@ -121,7 +115,7 @@ namespace http {
121115
uri_ = new_uri;
122116
}
123117

124-
boost::network::uri::basic_uri<typename string<Tag>::type>const &uri()const {
118+
boost::network::uri::http::basic_uri<Tag>const &uri()const {
125119
return uri_;
126120
}
127121

‎boost/network/protocol/http/message/wrappers/port.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace boost { namespace network { namespace http {
3030
}
3131

3232
operator boost::optional<boost::uint16_t> () {
33-
returnuri::port_us(message_.uri());
33+
returnport_us(message_.uri());
3434
}
3535
};
3636

‎boost/network/protocol/http/message/wrappers/uri.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// (See accompanying file LICENSE_1_0.txt or copy at
88
// http://www.boost.org/LICENSE_1_0.txt)
99

10-
#include<boost/network/uri/uri.hpp>
10+
#include<boost/network/uri/http/uri.hpp>
1111

1212
namespaceboost {namespacenetwork {namespacehttp {
1313

@@ -24,7 +24,7 @@ namespace boost { namespace network { namespace http {
2424
operatorstring_type() {
2525
return message_.uri().raw();
2626
}
27-
operator boost::network::uri::basic_uri<typename string<Tag>::type> () {
27+
operator boost::network::uri::basic_uri<tags::http_default_8bit_tcp_resolve> () {
2828
return message_.uri();
2929
}
3030
};
@@ -40,6 +40,6 @@ namespace boost { namespace network { namespace http {
4040

4141
}// namespace network
4242

43-
}//namespace boost
43+
}//nmaespace boost
4444

4545
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_URI_HPP_20100620

‎boost/network/uri.hpp‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,24 @@
66
// (See accompanying file LICENSE_1_0.txt or copy at
77
// http://www.boost.org/LICENSE_1_0.txt)
88

9+
#include<boost/network/traits/string.hpp>
910
#include<boost/network/uri/uri.hpp>
11+
#include<boost/network/protocol/http/tags.hpp>
12+
#include<boost/network/uri/http/uri.hpp>
13+
14+
15+
namespaceboost {namespacenetwork {namespaceuri {
16+
17+
typedef basic_uri<boost::network::tags::default_string> uri;
18+
typedef basic_uri<boost::network::tags::default_wstring> wuri;
19+
20+
namespacehttp {
21+
typedef basic_uri<boost::network::http::tags::http_default_8bit_udp_resolve> uri;
22+
}
23+
24+
}// namespace uri
25+
}// namespace network
26+
}// namespace boost
1027

1128
#endif
1229

‎boost/network/uri/accessors.hpp‎

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@
1212
#include<boost/network/uri/encode.hpp>
1313
#include<boost/network/uri/decode.hpp>
1414
#include<boost/spirit/include/qi.hpp>
15-
#include<boost/fusion/include/std_pair.hpp>
1615

1716

1817
namespaceboost {
1918
namespacenetwork {
2019
namespaceuri {
2120
namespacedetails {
2221
template<
22+
typename Uri,
2323
typename Map
2424
>
2525
structkey_value_sequence
26-
: spirit::qi::grammar<uri::const_iterator, Map()>
26+
: spirit::qi::grammar<typename Uri::const_iterator_type, Map()>
2727
{
28+
typedeftypename Uri::const_iterator_type const_iterator_type;
29+
2830
key_value_sequence()
2931
: key_value_sequence::base_type(query)
3032
{
@@ -34,63 +36,79 @@ struct key_value_sequence
3436
value = +spirit::qi::char_("a-zA-Z_0-9/%");
3537
}
3638

37-
spirit::qi::rule<uri::const_iterator, Map()> query;
38-
spirit::qi::rule<uri::const_iterator, std::pair<std::string, std::string>()> pair;
39-
spirit::qi::rule<uri::const_iterator,typenamestd::string()> key, value;
39+
spirit::qi::rule<const_iterator_type, Map()> query;
40+
spirit::qi::rule<const_iterator_type, std::pair<typename Uri::string_type,typename Uri::string_type>()> pair;
41+
spirit::qi::rule<const_iterator_type,typenameUri::string_type()> key, value;
4042
};
4143
}// namespace details
4244

4345
template<
46+
classTag,
4447
classMap
4548
>
4649
inline
47-
Map &query_map(consturi &uri_, Map &map) {
48-
uri::const_range_type range =uri_.query_range();
49-
details::key_value_sequence<Map> parser;
50+
Map &query_map(constbasic_uri<Tag> &uri, Map &map) {
51+
typename basic_uri<Tag>::const_range_type range =uri.query_range();
52+
details::key_value_sequence<basic_uri<Tag>,Map> parser;
5053
spirit::qi::parse(boost::begin(range),boost::end(range), parser, map);
5154
return map;
5255
}
5356

54-
std::stringusername(const uri &uri_) {
55-
uri::const_range_type user_info_range = uri_.user_info_range();
56-
uri::const_iteratorit(boost::begin(user_info_range)),end(boost::end(user_info_range));
57+
template<
58+
classTag
59+
>
60+
typename basic_uri<Tag>::string_typeusername(const basic_uri<Tag> &uri) {
61+
typename basic_uri<Tag>::const_range_type user_info_range = uri.user_info_range();
62+
typename basic_uri<Tag>::const_iterator_typeit(boost::begin(user_info_range)),end(boost::end(user_info_range));
5763
for (; it != end; ++it) {
5864
if (*it ==':') {
5965
break;
6066
}
6167
}
62-
returnstd::string(boost::begin(user_info_range), it);
68+
returntypename string<Tag>::type(boost::begin(user_info_range), it);
6369
}
6470

65-
std::stringpassword(const uri &uri_) {
66-
uri::const_range_type user_info_range = uri_.user_info_range();
67-
uri::const_iteratorit(boost::begin(user_info_range)),end(boost::end(user_info_range));
71+
template<
72+
classTag
73+
>
74+
typename basic_uri<Tag>::string_typepassword(const basic_uri<Tag> &uri) {
75+
typename basic_uri<Tag>::const_range_type user_info_range = uri.user_info_range();
76+
typename basic_uri<Tag>::const_iterator_typeit(boost::begin(user_info_range)),end(boost::end(user_info_range));
6877
for (; it != end; ++it) {
6978
if (*it ==':') {
7079
++it;
7180
break;
7281
}
7382
}
74-
returnstd::string(it,boost::end(user_info_range));
83+
returntypename string<Tag>::type(it,boost::end(user_info_range));
7584
}
7685

77-
std::stringdecoded_path(const uri &uri_) {
78-
uri::const_range_type path_range = uri_.path_range();
79-
std::string decoded_path;
86+
template<
87+
classTag
88+
>
89+
typename basic_uri<Tag>::string_typedecoded_path(const basic_uri<Tag> &uri) {
90+
typename basic_uri<Tag>::const_range_type path_range = uri.path_range();
91+
typename basic_uri<Tag>::string_type decoded_path;
8092
decode(path_range,std::back_inserter(decoded_path));
8193
return decoded_path;
8294
}
8395

84-
std::stringdecoded_query(const uri &uri_) {
85-
uri::const_range_type query_range = uri_.query_range();
86-
std::string decoded_query;
96+
template<
97+
classTag
98+
>
99+
typename basic_uri<Tag>::string_typedecoded_query(const basic_uri<Tag> &uri) {
100+
typename basic_uri<Tag>::const_range_type query_range = uri.query_range();
101+
typename basic_uri<Tag>::string_type decoded_query;
87102
decode(query_range,std::back_inserter(decoded_query));
88103
return decoded_query;
89104
}
90105

91-
std::stringdecoded_fragment(const uri &uri_) {
92-
uri::const_range_type fragment_range = uri_.fragment_range();
93-
std::string decoded_fragment;
106+
template<
107+
classTag
108+
>
109+
typename basic_uri<Tag>::string_typedecoded_fragment(const basic_uri<Tag> &uri) {
110+
typename basic_uri<Tag>::const_range_type fragment_range = uri.fragment_range();
111+
typename basic_uri<Tag>::string_type decoded_fragment;
94112
decode(fragment_range,std::back_inserter(decoded_fragment));
95113
return decoded_fragment;
96114
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp