Skip to content

Commit 9b16957

Browse files
committed
Some minor changes to the URI interface.
1 parent 380e552 commit 9b16957

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

boost/network/uri/uri.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ class basic_uri
181181
return string_type(boost::begin(range), boost::end(range));
182182
}
183183

184-
string_type to_string() const {
184+
string_type string() const {
185185
return uri_;
186186
}
187187

188188
string_type raw() const {
189-
return to_string();
189+
return string();
190190
}
191191

192192
bool is_valid() const {
@@ -198,7 +198,7 @@ class basic_uri
198198
void parse();
199199

200200
string_type uri_;
201-
detail::uri_parts<typename string<Tag>::type> uri_parts_;
201+
detail::uri_parts<typename boost::network::string<Tag>::type> uri_parts_;
202202
bool is_valid_;
203203

204204
};
@@ -337,7 +337,7 @@ template <
337337
>
338338
inline
339339
bool operator == (const basic_uri<Tag> &lhs, const basic_uri<Tag> &rhs) {
340-
return lhs.to_string() == rhs.to_string();
340+
return std::equal(lhs.begin(), lhs.end(), rhs.begin());
341341
}
342342
} // namespace uri
343343
} // namespace network

boost/network/uri/uri_accessors.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ struct key_value_sequence
2424
{
2525
query = pair >> *((spirit::qi::lit(';') | '&') >> pair);
2626
pair = key >> -('=' >> value);
27-
key = spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9%");
28-
value = +spirit::qi::char_("a-zA-Z_0-9%");
27+
key = spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9/%");
28+
value = +spirit::qi::char_("a-zA-Z_0-9/%");
2929
}
3030

3131
spirit::qi::rule<const_iterator_type, Map()> query;

libs/network/test/uri/url_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(assignment_test, T, tag_types) {
233233
uri_type instance(string_type(boost::begin(url), boost::end(url)));
234234
uri_type copy;
235235
copy = instance;
236-
BOOST_CHECK(instance.to_string() == copy.to_string());
236+
BOOST_CHECK(instance.string() == copy.string());
237237
BOOST_CHECK(instance == copy);
238238
}
239239

@@ -277,7 +277,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_query_map_test, T, tag_types) {
277277

278278
std::map<string_type, string_type> queries;
279279
uri::query_map(instance, queries);
280-
BOOST_CHECK_EQUAL(queries.size(), std::size_t(1));
280+
BOOST_REQUIRE_EQUAL(queries.size(), std::size_t(1));
281281
BOOST_CHECK(boost::equal(queries.begin()->first, key));
282282
BOOST_CHECK(boost::equal(queries.begin()->second, value));
283283
}
@@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(xmpp_query_map_test, T, tag_types) {
295295

296296
std::map<string_type, string_type> queries;
297297
uri::query_map(instance, queries);
298-
BOOST_CHECK_EQUAL(queries.size(), std::size_t(2));
298+
BOOST_REQUIRE_EQUAL(queries.size(), std::size_t(2));
299299
BOOST_CHECK(boost::equal(queries.begin()->first, key_1));
300300
BOOST_CHECK(boost::equal(queries.begin()->second, value_1));
301301
BOOST_CHECK(boost::equal((++queries.begin())->first, key_2));

0 commit comments

Comments
 (0)