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

Commitbbf431c

Browse files
committed
Backport fix for#163 into 0.11.0
1 parent8c28ccc commitbbf431c

File tree

3 files changed

+367
-329
lines changed

3 files changed

+367
-329
lines changed

‎boost/network/uri/accessors.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ struct key_value_sequence
3434
{
3535
query = pair >> *((spirit::qi::lit(';') |'&') >> pair);
3636
pair = key >> -('=' >> value);
37-
key =spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9/%");
38-
value = +spirit::qi::char_("a-zA-Z_0-9/%");
37+
key =spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("-+.~a-zA-Z_0-9/%");
38+
value = +spirit::qi::char_("-+.~a-zA-Z_0-9/%");
3939
}
4040

4141
spirit::qi::rule<uri::const_iterator, Map()> query;

‎boost/network/uri/decode.hpp‎

Lines changed: 45 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,21 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
76
#ifndef __BOOST_NETWORK_URI_DECODE_INC__
8-
#define__BOOST_NETWORK_URI_DECODE_INC__
9-
10-
11-
#include<boost/iterator/iterator_traits.hpp>
12-
#include<boost/range/begin.hpp>
13-
#include<boost/range/end.hpp>
14-
#include<cassert>
7+
#define__BOOST_NETWORK_URI_DECODE_INC__
158

9+
#include<boost/iterator/iterator_traits.hpp>
10+
#include<boost/range/begin.hpp>
11+
#include<boost/range/end.hpp>
12+
#include<cassert>
1613

1714
namespaceboost {
1815
namespacenetwork {
1916
namespaceuri {
2017
namespacedetail {
21-
template<
22-
typename CharT
23-
>
24-
CharTletter_to_hex(CharT in)
25-
{
26-
switch (in)
27-
{
18+
template<typename CharT>
19+
CharTletter_to_hex(CharT in) {
20+
switch (in) {
2821
case'0':
2922
case'1':
3023
case'2':
@@ -35,74 +28,65 @@ CharT letter_to_hex(CharT in)
3528
case'7':
3629
case'8':
3730
case'9':
38-
return in -'0';
31+
return in -'0';
3932
case'a':
4033
case'b':
4134
case'c':
4235
case'd':
4336
case'e':
4437
case'f':
45-
return in +10 -'a';
38+
return in +10 -'a';
4639
case'A':
4740
case'B':
4841
case'C':
4942
case'D':
5043
case'E':
5144
case'F':
52-
return in +10 -'A';
53-
}
54-
returnCharT();
45+
return in +10 -'A';
46+
}
47+
returnCharT();
5548
}
56-
}// namespace detail
49+
}// namespace detail
5750

58-
template<
59-
classInputIterator,
60-
classOutputIterator
61-
>
51+
template<classInputIterator,classOutputIterator>
6252
OutputIteratordecode(const InputIterator &in_begin,
6353
const InputIterator &in_end,
6454
const OutputIterator &out_begin) {
65-
typedeftypename boost::iterator_value<InputIterator>::type value_type;
55+
typedeftypename boost::iterator_value<InputIterator>::type value_type;
6656

67-
InputIterator it = in_begin;
68-
OutputIterator out = out_begin;
69-
while (it != in_end) {
70-
if (*it =='%')
71-
{
72-
++it;
73-
value_type v0 =detail::letter_to_hex(*it);
74-
++it;
75-
value_type v1 =detail::letter_to_hex(*it);
76-
++it;
77-
*out++ =0x10 * v0 + v1;
78-
}
79-
else
80-
{
81-
*out++ = *it++;
82-
}
57+
InputIterator it = in_begin;
58+
OutputIterator out = out_begin;
59+
while (it != in_end) {
60+
if (*it =='%') {
61+
++it;
62+
value_type v0 =detail::letter_to_hex(*it);
63+
++it;
64+
value_type v1 =detail::letter_to_hex(*it);
65+
++it;
66+
*out++ =0x10 * v0 + v1;
67+
}elseif (*it =='+') {
68+
*out++ ='';
69+
++it;
70+
}else {
71+
*out++ = *it++;
8372
}
84-
return out;
73+
}
74+
return out;
8575
}
8676

87-
template<
88-
classSinglePassRange,
89-
classOutputIterator
90-
>
91-
inline
92-
OutputIteratordecode(const SinglePassRange &range,
93-
const OutputIterator &out) {
94-
returndecode(boost::begin(range),boost::end(range), out);
77+
template<classSinglePassRange,classOutputIterator>
78+
inline OutputIteratordecode(const SinglePassRange &range,
79+
const OutputIterator &out) {
80+
returndecode(boost::begin(range),boost::end(range), out);
9581
}
9682

97-
inline
98-
std::stringdecoded(const std::string &input) {
99-
std::string decoded;
100-
decode(input,std::back_inserter(decoded));
101-
return decoded;
83+
inline std::stringdecoded(const std::string &input) {
84+
std::string decoded;
85+
decode(input,std::back_inserter(decoded));
86+
return decoded;
10287
}
103-
}// namespace uri
104-
}// namespace network
105-
}// namespace boost
106-
88+
}// namespace uri
89+
}// namespace network
90+
}// namespace boost
10791

108-
#endif// __BOOST_NETWORK_URI_DECODE_INC__
92+
#endif// __BOOST_NETWORK_URI_DECODE_INC__

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp