Skip to content

Commit 78d6f12

Browse files
committed
Some minor changes to the URI interface.
1 parent 1ee8b61 commit 78d6f12

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
};
@@ -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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(assignment_test, T, tag_types) {
243243
uri_type instance(string_type(boost::begin(url), boost::end(url)));
244244
uri_type copy;
245245
copy = instance;
246-
BOOST_CHECK(instance.to_string() == copy.to_string());
246+
BOOST_CHECK(instance.string() == copy.string());
247247
BOOST_CHECK(instance == copy);
248248
}
249249

@@ -287,7 +287,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(http_query_map_test, T, tag_types) {
287287

288288
std::map<string_type, string_type> queries;
289289
uri::query_map(instance, queries);
290-
BOOST_CHECK_EQUAL(queries.size(), std::size_t(1));
290+
BOOST_REQUIRE_EQUAL(queries.size(), std::size_t(1));
291291
BOOST_CHECK(boost::equal(queries.begin()->first, key));
292292
BOOST_CHECK(boost::equal(queries.begin()->second, value));
293293
}
@@ -305,7 +305,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(xmpp_query_map_test, T, tag_types) {
305305

306306
std::map<string_type, string_type> queries;
307307
uri::query_map(instance, queries);
308-
BOOST_CHECK_EQUAL(queries.size(), std::size_t(2));
308+
BOOST_REQUIRE_EQUAL(queries.size(), std::size_t(2));
309309
BOOST_CHECK(boost::equal(queries.begin()->first, key_1));
310310
BOOST_CHECK(boost::equal(queries.begin()->second, value_1));
311311
BOOST_CHECK(boost::equal((++queries.begin())->first, key_2));

0 commit comments

Comments
 (0)