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

Commitcd5b003

Browse files
committed
Merge pull request#7 from glynos/0.9-devel
0.9 devel
2 parentse1785e0 +bb9521f commitcd5b003

31 files changed

+697
-1326
lines changed

‎boost/network/uri.hpp‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,7 @@
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>
109
#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<std::string> uri;
18-
typedef basic_uri<std::wstring> wuri;
19-
20-
//namespace http {
21-
//typedef basic_uri<boost::network::http::tags::http_default_8bit_udp_resolve> uri;
22-
//}
23-
}// namespace uri
24-
}// namespace network
25-
}// namespace boost
2610

2711
#endif
2812

‎boost/network/uri/accessors.hpp‎

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@
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>
1516

1617

1718
namespaceboost {
1819
namespacenetwork {
1920
namespaceuri {
2021
namespacedetails {
2122
template<
22-
typename Uri,
2323
typename Map
2424
>
2525
structkey_value_sequence
26-
: spirit::qi::grammar<typename Uri::const_iterator, Map()>
26+
: spirit::qi::grammar<uri::const_iterator, Map()>
2727
{
28-
typedeftypename Uri::const_iterator const_iterator;
29-
3028
key_value_sequence()
3129
: key_value_sequence::base_type(query)
3230
{
@@ -36,79 +34,63 @@ struct key_value_sequence
3634
value = +spirit::qi::char_("a-zA-Z_0-9/%");
3735
}
3836

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;
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;
4240
};
4341
}// namespace details
4442

4543
template<
46-
classString,
4744
classMap
4845
>
4946
inline
50-
Map &query_map(constbasic_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;
47+
Map &query_map(consturi &uri_, Map &map) {
48+
uri::const_range_type range =uri_.query_range();
49+
details::key_value_sequence<Map> parser;
5350
spirit::qi::parse(boost::begin(range),boost::end(range), parser, map);
5451
return map;
5552
}
5653

57-
template<
58-
classString
59-
>
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));
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));
6357
for (; it != end; ++it) {
6458
if (*it ==':') {
6559
break;
6660
}
6761
}
68-
returnString(boost::begin(user_info_range), it);
62+
returnstd::string(boost::begin(user_info_range), it);
6963
}
7064

71-
template<
72-
classString
73-
>
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));
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));
7768
for (; it != end; ++it) {
7869
if (*it ==':') {
7970
++it;
8071
break;
8172
}
8273
}
83-
returnString(it,boost::end(user_info_range));
74+
returnstd::string(it,boost::end(user_info_range));
8475
}
8576

86-
template<
87-
classString
88-
>
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;
77+
std::stringdecoded_path(const uri &uri_) {
78+
uri::const_range_type path_range = uri_.path_range();
79+
std::string decoded_path;
9280
decode(path_range,std::back_inserter(decoded_path));
9381
return decoded_path;
9482
}
9583

96-
template<
97-
classString
98-
>
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;
84+
std::stringdecoded_query(const uri &uri_) {
85+
uri::const_range_type query_range = uri_.query_range();
86+
std::string decoded_query;
10287
decode(query_range,std::back_inserter(decoded_query));
10388
return decoded_query;
10489
}
10590

106-
template<
107-
classString
108-
>
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;
91+
std::stringdecoded_fragment(const uri &uri_) {
92+
uri::const_range_type fragment_range = uri_.fragment_range();
93+
std::string decoded_fragment;
11294
decode(fragment_range,std::back_inserter(decoded_fragment));
11395
return decoded_fragment;
11496
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp