@@ -25,6 +25,10 @@ template <
2525struct key_value_sequence
2626 : spirit::qi::grammar<uri::const_iterator, Map()>
2727{
28+ typedef typename Map::key_type key_type;
29+ typedef typename Map::mapped_type mapped_type;
30+ typedef std::pair<key_type, mapped_type> pair_type;
31+
2832key_value_sequence ()
2933 : key_value_sequence::base_type(query)
3034 {
@@ -35,8 +39,9 @@ struct key_value_sequence
3539 }
3640
3741 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,typename std::string ()> key, value;
42+ spirit::qi::rule<uri::const_iterator, pair_type()> pair;
43+ spirit::qi::rule<uri::const_iterator, key_type()> key;
44+ spirit::qi::rule<uri::const_iterator, mapped_type()> value;
4045};
4146}// namespace details
4247
@@ -45,57 +50,57 @@ template <
4550 >
4651inline
4752Map &query_map (const uri &uri_, Map &map) {
48- const std::string range = uri_.query ();
53+ const uri::string_type range = uri_.query ();
4954 details::key_value_sequence<Map> parser;
5055spirit::qi::parse (boost::begin (range),boost::end (range), parser, map);
5156return map;
5257}
5358
5459inline
55- std::string username (const uri &uri_) {
56- const std::string user_info = uri_.user_info ();
60+ uri::string_type username (const uri &uri_) {
61+ const uri::string_type user_info = uri_.user_info ();
5762 uri::const_iteratorit (boost::begin (user_info)),end (boost::end (user_info));
5863for (; it != end; ++it) {
5964if (*it ==' :' ) {
6065break ;
6166 }
6267 }
63- return std::string (boost::begin (user_info), it);
68+ return uri::string_type (boost::begin (user_info), it);
6469}
6570
6671inline
67- std::string password (const uri &uri_) {
68- const std::string user_info = uri_.user_info ();
72+ uri::string_type password (const uri &uri_) {
73+ const uri::string_type user_info = uri_.user_info ();
6974 uri::const_iteratorit (boost::begin (user_info)),end (boost::end (user_info));
7075for (; it != end; ++it) {
7176if (*it ==' :' ) {
7277 ++it;
7378break ;
7479 }
7580 }
76- return std::string (it,boost::end (user_info));
81+ return uri::string_type (it,boost::end (user_info));
7782}
7883
7984inline
80- std::string decoded_path (const uri &uri_) {
81- const std::string path = uri_.path ();
82- std::string decoded_path;
85+ uri::string_type decoded_path (const uri &uri_) {
86+ const uri::string_type path = uri_.path ();
87+ uri::string_type decoded_path;
8388decode (path,std::back_inserter (decoded_path));
8489return decoded_path;
8590}
8691
8792inline
88- std::string decoded_query (const uri &uri_) {
89- const std::string query = uri_.query ();
90- std::string decoded_query;
93+ uri::string_type decoded_query (const uri &uri_) {
94+ const uri::string_type query = uri_.query ();
95+ uri::string_type decoded_query;
9196decode (query,std::back_inserter (decoded_query));
9297return decoded_query;
9398}
9499
95100inline
96- std::string decoded_fragment (const uri &uri_) {
97- const std::string fragment = uri_.fragment ();
98- std::string decoded_fragment;
101+ uri::string_type decoded_fragment (const uri &uri_) {
102+ const uri::string_type fragment = uri_.fragment ();
103+ uri::string_type decoded_fragment;
99104decode (fragment,std::back_inserter (decoded_fragment));
100105return decoded_fragment;
101106}