Skip to content

Commit eb44790

Browse files
committed
Some minor changes to the URI interface.
1 parent 2eebc55 commit eb44790

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

boost/network/uri/uri.hpp

+4-4
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
};
@@ -345,7 +345,7 @@ template <
345345
>
346346
inline
347347
bool operator == (const basic_uri<Tag> &lhs, const basic_uri<Tag> &rhs) {
348-
return lhs.to_string() == rhs.to_string();
348+
return std::equal(lhs.begin(), lhs.end(), rhs.begin());
349349
}
350350
} // namespace uri
351351
} // namespace network

boost/network/uri/uri_accessors.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct key_value_sequence
3232
{
3333
query = pair >> *((spirit::qi::lit(';') | '&') >> pair);
3434
pair = key >> -('=' >> value);
35-
key = spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9%");
36-
value = +spirit::qi::char_("a-zA-Z_0-9%");
35+
key = spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9/%");
36+
value = +spirit::qi::char_("a-zA-Z_0-9/%");
3737
}
3838

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

libs/network/test/uri/url_test.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(assignment_test, T, tag_types) {
235235
uri_type instance(string_type(boost::begin(url), boost::end(url)));
236236
uri_type copy;
237237
copy = instance;
238-
BOOST_CHECK(instance.to_string() == copy.to_string());
238+
BOOST_CHECK(instance.string() == copy.string());
239239
BOOST_CHECK(instance == copy);
240240
}
241241

@@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_query_map_test, T, tag_types) {
279279

280280
std::map<string_type, string_type> queries;
281281
uri::query_map(instance, queries);
282-
BOOST_CHECK_EQUAL(queries.size(), std::size_t(1));
282+
BOOST_REQUIRE_EQUAL(queries.size(), std::size_t(1));
283283
BOOST_CHECK(boost::equal(queries.begin()->first, key));
284284
BOOST_CHECK(boost::equal(queries.begin()->second, value));
285285
}
@@ -297,7 +297,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(xmpp_query_map_test, T, tag_types) {
297297

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

0 commit comments

Comments
 (0)