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

Commitbd77b44

Browse files
committed
template is now a class . No support for std::wstring.
1 parent77e6e53 commitbd77b44

File tree

18 files changed

+380
-1001
lines changed

18 files changed

+380
-1001
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: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ namespace network {
2020
namespaceuri {
2121
namespacedetails {
2222
template<
23-
typename Uri,
2423
typename Map
2524
>
2625
structkey_value_sequence
27-
: spirit::qi::grammar<typename Uri::const_iterator, Map()>
26+
: spirit::qi::grammar<uri::const_iterator, Map()>
2827
{
29-
typedeftypename Uri::const_iterator const_iterator;
30-
3128
key_value_sequence()
3229
: key_value_sequence::base_type(query)
3330
{
@@ -37,79 +34,63 @@ struct key_value_sequence
3734
value = +spirit::qi::char_("a-zA-Z_0-9/%");
3835
}
3936

40-
spirit::qi::rule<const_iterator, Map()> query;
41-
spirit::qi::rule<const_iterator, std::pair<typename Uri::string_type,typename Uri::string_type>()> pair;
42-
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;
4340
};
4441
}// namespace details
4542

4643
template<
47-
classString,
4844
classMap
4945
>
5046
inline
51-
Map &query_map(constbasic_uri<String> &uri, Map &map) {
52-
typename basic_uri<String>::const_range_type range =uri.query_range();
53-
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;
5450
spirit::qi::parse(boost::begin(range),boost::end(range), parser, map);
5551
return map;
5652
}
5753

58-
template<
59-
classString
60-
>
61-
Stringusername(const basic_uri<String> &uri) {
62-
typename basic_uri<String>::const_range_type user_info_range = uri.user_info_range();
63-
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));
6457
for (; it != end; ++it) {
6558
if (*it ==':') {
6659
break;
6760
}
6861
}
69-
returnString(boost::begin(user_info_range), it);
62+
returnstd::string(boost::begin(user_info_range), it);
7063
}
7164

72-
template<
73-
classString
74-
>
75-
Stringpassword(const basic_uri<String> &uri) {
76-
typename basic_uri<String>::const_range_type user_info_range = uri.user_info_range();
77-
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));
7868
for (; it != end; ++it) {
7969
if (*it ==':') {
8070
++it;
8171
break;
8272
}
8373
}
84-
returnString(it,boost::end(user_info_range));
74+
returnstd::string(it,boost::end(user_info_range));
8575
}
8676

87-
template<
88-
classString
89-
>
90-
Stringdecoded_path(const basic_uri<String> &uri) {
91-
typename basic_uri<String>::const_range_type path_range = uri.path_range();
92-
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;
9380
decode(path_range,std::back_inserter(decoded_path));
9481
return decoded_path;
9582
}
9683

97-
template<
98-
classString
99-
>
100-
Stringdecoded_query(const basic_uri<String> &uri) {
101-
typename basic_uri<String>::const_range_type query_range = uri.query_range();
102-
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;
10387
decode(query_range,std::back_inserter(decoded_query));
10488
return decoded_query;
10589
}
10690

107-
template<
108-
classString
109-
>
110-
Stringdecoded_fragment(const basic_uri<String> &uri) {
111-
typename basic_uri<String>::const_range_type fragment_range = uri.fragment_range();
112-
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;
11394
decode(fragment_range,std::back_inserter(decoded_fragment));
11495
return decoded_fragment;
11596
}

‎boost/network/uri/directives.hpp‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,21 @@
1616
namespaceboost {
1717
namespacenetwork {
1818
namespaceuri {
19-
template<
20-
classString
21-
>
2219
inline
23-
basic_uri<String> &operator << (basic_uri<String> &uri,constbasic_uri<String> &root_uri) {
24-
if (empty(uri) &&valid(root_uri)) {
25-
uri.append(boost::begin(root_uri),boost::end(root_uri));
20+
uri &operator << (uri &uri_,consturi &root_uri) {
21+
if (empty(uri_) &&valid(root_uri)) {
22+
uri_.append(boost::begin(root_uri),boost::end(root_uri));
2623
}
27-
returnuri;
24+
returnuri_;
2825
}
2926

3027
template<
31-
classString
32-
,classDirective
28+
classDirective
3329
>
3430
inline
35-
basic_uri<String> &operator << (basic_uri<String> &uri,const Directive &directive) {
36-
directive(uri);
37-
returnuri;
31+
uri &operator << (uri &uri_,const Directive &directive) {
32+
directive(uri_);
33+
returnuri_;
3834
}
3935
}// namespace uri
4036
}// namespace network

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

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,26 @@
22
#define__BOOST_NETWORK_URI_DIRECTIVES_AUTHORITY_INC__
33

44

5-
#include<boost/range/as_literal.hpp>
6-
7-
8-
95
namespaceboost {
106
namespacenetwork {
117
namespaceuri {
12-
template<
13-
classValueType
14-
>
158
structauthority_directive {
169

17-
explicitauthority_directive(constValueType &value)
18-
:value(value)
10+
explicitauthority_directive(conststd::string &authority)
11+
:authority(authority)
1912
{}
2013

21-
template<
22-
classTag
23-
,template<class>classUri
24-
>
25-
voidoperator () (Uri<Tag> &uri)const {
26-
uri.append(value);
14+
voidoperator () (uri &uri_)const {
15+
uri_.append(authority);
2716
}
2817

29-
const ValueType &value;
18+
std::string authority;
3019

3120
};
3221

33-
template<
34-
classT
35-
>
3622
inline
37-
authority_directive<T>authority(constT &value) {
38-
return authority_directive<T>(value);
23+
authority_directiveauthority(conststd::string &authority) {
24+
returnauthority_directive(authority);
3925
}
4026
}// namespace uri
4127
}// namespace network

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

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,27 @@
1010
namespaceboost {
1111
namespacenetwork {
1212
namespaceuri {
13-
template<
14-
classValueType
15-
>
1613
structfragment_directive {
1714

18-
explicitfragment_directive(constValueType &value)
19-
:value(value)
15+
explicitfragment_directive(conststd::string &fragment)
16+
:fragment(fragment)
2017
{}
2118

22-
template<
23-
classString
24-
,template<class>classUri
25-
>
26-
voidoperator () (Uri<String> &uri)const {
27-
String encoded_value;
19+
voidoperator () (uri &uri_)const {
20+
std::string encoded_fragment;
2821
staticconstchar separator[] = {'#'};
29-
uri.append(boost::begin(separator),boost::end(separator));
30-
encode(boost::as_literal(value),std::back_inserter(encoded_value));
31-
uri.append(encoded_value);
22+
uri_.append(boost::begin(separator),boost::end(separator));
23+
encode(fragment,std::back_inserter(encoded_fragment));
24+
uri_.append(encoded_fragment);
3225
}
3326

34-
const ValueType &value;
27+
std::string fragment;
3528

3629
};
3730

38-
template<
39-
classT
40-
>
4131
inline
42-
fragment_directive<T>fragment(constT &value) {
43-
return fragment_directive<T>(value);
32+
fragment_directivefragment(conststd::string &fragment) {
33+
returnfragment_directive(fragment);
4434
}
4535
}// namespace uri
4636
}// namespace network

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

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,23 @@
99
namespaceboost {
1010
namespacenetwork {
1111
namespaceuri {
12-
template<
13-
classValueType
14-
>
1512
structhost_directive {
1613

17-
explicithost_directive(constValueType &value)
18-
:value(value)
14+
explicithost_directive(conststd::string &host)
15+
:host(host)
1916
{}
2017

21-
template<
22-
classTag
23-
,template<class>classUri
24-
>
25-
voidoperator () (Uri<Tag> &uri)const {
26-
uri.append(value);
18+
voidoperator () (uri &uri_)const {
19+
uri_.append(host);
2720
}
2821

29-
const ValueType &value;
22+
std::string host;
3023

3124
};
3225

33-
template<
34-
classT
35-
>
3626
inline
37-
host_directive<T>host(constT &value) {
38-
return host_directive<T>(value);
27+
host_directivehost(conststd::string &host) {
28+
returnhost_directive(host);
3929
}
4030
}// namespace uri
4131
}// namespace network

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp