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

Commite1785e0

Browse files
committed
Merge pull request#6 from glynos/0.9-devel
0.9 devel
2 parentsc1d5ba4 +deb5553 commite1785e0

File tree

21 files changed

+339
-438
lines changed

21 files changed

+339
-438
lines changed

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

Lines changed: 12 additions & 6 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/http/uri.hpp>
18+
#include<boost/network/uri/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::http::basic_uri<Tag> uri_;
53+
mutable boost::network::uri::basic_uri<typename string<Tag>::type> uri_;
5454
typedef basic_message<Tag> base_type;
5555

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

8282
voidswap(basic_request & other) {
83-
using boost::network::uri::swap;
8483
base_type &base_ref(other);
8584
basic_request<Tag> &this_ref(*this);
8685
base_ref.swap(this_ref);
87-
swap(other.uri_,this->uri_);
86+
boost::swap(other.uri_,this->uri_);
8887
}
8988

9089
string_typeconsthost()const {
9190
return uri_.host();
9291
}
9392

9493
port_typeport()const {
95-
returnuri::port_us(uri_);
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;
96102
}
97103

98104
string_typeconstpath()const {
@@ -115,7 +121,7 @@ namespace http {
115121
uri_ = new_uri;
116122
}
117123

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

‎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-
returnport_us(message_.uri());
33+
returnuri::port_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/http/uri.hpp>
10+
#include<boost/network/uri/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<tags::http_default_8bit_tcp_resolve> () {
27+
operator boost::network::uri::basic_uri<typename string<Tag>::type> () {
2828
return message_.uri();
2929
}
3030
};
@@ -40,6 +40,6 @@ namespace boost { namespace network { namespace http {
4040

4141
}// namespace network
4242

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

4545
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_URI_HPP_20100620

‎boost/network/uri.hpp‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88

99
#include<boost/network/traits/string.hpp>
1010
#include<boost/network/uri/uri.hpp>
11-
#include<boost/network/protocol/http/tags.hpp>
12-
#include<boost/network/uri/http/uri.hpp>
11+
//#include <boost/network/protocol/http/tags.hpp>
12+
//#include <boost/network/uri/http/uri.hpp>
1313

1414

1515
namespaceboost {namespacenetwork {namespaceuri {
1616

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-
}
17+
typedef basic_uri<std::string> uri;
18+
typedef basic_uri<std::wstring> wuri;
2319

20+
//namespace http {
21+
//typedef basic_uri<boost::network::http::tags::http_default_8bit_udp_resolve> uri;
22+
//}
2423
}// namespace uri
2524
}// namespace network
2625
}// namespace boost

‎boost/network/uri/accessors.hpp‎

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ template <
2323
typename Map
2424
>
2525
structkey_value_sequence
26-
: spirit::qi::grammar<typename Uri::const_iterator_type, Map()>
26+
: spirit::qi::grammar<typename Uri::const_iterator, Map()>
2727
{
28-
typedeftypename Uri::const_iterator_type const_iterator_type;
28+
typedeftypename Uri::const_iterator const_iterator;
2929

3030
key_value_sequence()
3131
: key_value_sequence::base_type(query)
@@ -36,79 +36,79 @@ struct key_value_sequence
3636
value = +spirit::qi::char_("a-zA-Z_0-9/%");
3737
}
3838

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;
39+
spirit::qi::rule<const_iterator, Map()> query;
40+
spirit::qi::rule<const_iterator, std::pair<typename Uri::string_type,typename Uri::string_type>()> pair;
41+
spirit::qi::rule<const_iterator,typenameUri::string_type()> key, value;
4242
};
4343
}// namespace details
4444

4545
template<
46-
classTag,
46+
classString,
4747
classMap
4848
>
4949
inline
50-
Map &query_map(const basic_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;
50+
Map &query_map(const basic_uri<String> &uri, Map &map) {
51+
typename basic_uri<String>::const_range_type range = uri.query_range();
52+
details::key_value_sequence<basic_uri<String>, Map> parser;
5353
spirit::qi::parse(boost::begin(range),boost::end(range), parser, map);
5454
return map;
5555
}
5656

5757
template<
58-
classTag
58+
classString
5959
>
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));
60+
Stringusername(const basic_uri<String> &uri) {
61+
typename basic_uri<String>::const_range_type user_info_range = uri.user_info_range();
62+
typename basic_uri<String>::const_iteratorit(boost::begin(user_info_range)),end(boost::end(user_info_range));
6363
for (; it != end; ++it) {
6464
if (*it ==':') {
6565
break;
6666
}
6767
}
68-
returntypename string<Tag>::type(boost::begin(user_info_range), it);
68+
returnString(boost::begin(user_info_range), it);
6969
}
7070

7171
template<
72-
classTag
72+
classString
7373
>
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));
74+
Stringpassword(const basic_uri<String> &uri) {
75+
typename basic_uri<String>::const_range_type user_info_range = uri.user_info_range();
76+
typename basic_uri<String>::const_iteratorit(boost::begin(user_info_range)),end(boost::end(user_info_range));
7777
for (; it != end; ++it) {
7878
if (*it ==':') {
7979
++it;
8080
break;
8181
}
8282
}
83-
returntypename string<Tag>::type(it,boost::end(user_info_range));
83+
returnString(it,boost::end(user_info_range));
8484
}
8585

8686
template<
87-
classTag
87+
classString
8888
>
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;
89+
Stringdecoded_path(const basic_uri<String> &uri) {
90+
typename basic_uri<String>::const_range_type path_range = uri.path_range();
91+
String decoded_path;
9292
decode(path_range,std::back_inserter(decoded_path));
9393
return decoded_path;
9494
}
9595

9696
template<
97-
classTag
97+
classString
9898
>
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;
99+
Stringdecoded_query(const basic_uri<String> &uri) {
100+
typename basic_uri<String>::const_range_type query_range = uri.query_range();
101+
String decoded_query;
102102
decode(query_range,std::back_inserter(decoded_query));
103103
return decoded_query;
104104
}
105105

106106
template<
107-
classTag
107+
classString
108108
>
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;
109+
Stringdecoded_fragment(const basic_uri<String> &uri) {
110+
typename basic_uri<String>::const_range_type fragment_range = uri.fragment_range();
111+
String decoded_fragment;
112112
decode(fragment_range,std::back_inserter(decoded_fragment));
113113
return decoded_fragment;
114114
}

‎boost/network/uri/detail/uri_parts.hpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
#include<boost/fusion/include/vector.hpp>
11-
#include<boost/fusion/sequence/intrinsic/at_c.hpp>
1211

1312

1413
namespaceboost {

‎boost/network/uri/directives.hpp‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,22 @@ namespace boost {
1717
namespacenetwork {
1818
namespaceuri {
1919
template<
20-
classTag
20+
classString
21+
>
22+
inline
23+
basic_uri<String> &operator << (basic_uri<String> &uri,const basic_uri<String> &root_uri) {
24+
if (empty(uri) &&valid(root_uri)) {
25+
uri.append(boost::begin(root_uri),boost::end(root_uri));
26+
}
27+
return uri;
28+
}
29+
30+
template<
31+
classString
2132
,classDirective
2233
>
2334
inline
24-
basic_uri<Tag> &operator << (basic_uri<Tag> &uri,const Directive &directive) {
35+
basic_uri<String> &operator << (basic_uri<String> &uri,const Directive &directive) {
2536
directive(uri);
2637
return uri;
2738
}

‎boost/network/uri/directives/authority.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ template <
3434
classT
3535
>
3636
inline
37-
authority_directive<T>authority(const T &value){
37+
authority_directive<T>authority(const T &value) {
3838
return authority_directive<T>(value);
3939
}
4040
}// namespace uri

‎boost/network/uri/directives/fragment.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ struct fragment_directive {
2020
{}
2121

2222
template<
23-
classTag
23+
classString
2424
,template<class>classUri
2525
>
26-
voidoperator () (Uri<Tag> &uri)const {
27-
typename string<Tag>::type encoded_value;
26+
voidoperator () (Uri<String> &uri)const {
27+
String encoded_value;
2828
staticconstchar separator[] = {'#'};
2929
uri.append(boost::begin(separator),boost::end(separator));
3030
encode(boost::as_literal(value),std::back_inserter(encoded_value));

‎boost/network/uri/directives/path.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ struct encoded_path_directive {
4949
{}
5050

5151
template<
52-
classTag
52+
classStringT
5353
,template<class>classUri
5454
>
55-
voidoperator () (Uri<Tag> &uri)const {
56-
typename string<Tag>::type encoded_value;
55+
voidoperator () (Uri<StringT> &uri)const {
56+
StringT encoded_value;
5757
encode(boost::as_literal(value),std::back_inserter(encoded_value));
5858
uri.append(encoded_value);
5959
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp