15
15
# include < boost/utility/swap.hpp>
16
16
# include < boost/range/algorithm/equal.hpp>
17
17
# include < boost/range/algorithm/copy.hpp>
18
+ # include < boost/range/as_literal.hpp>
18
19
# include < boost/range/iterator_range.hpp>
19
20
# include < boost/lexical_cast.hpp>
20
21
# include < boost/optional.hpp>
@@ -38,14 +39,25 @@ class BOOST_URI_DECL uri {
38
39
public:
39
40
40
41
typedef std::string string_type;
42
+ typedef string_type::value_type value_type;
41
43
typedef string_type::const_iterator const_iterator;
42
- typedef boost::iterator_range<std::string:: const_iterator> const_range_type;
44
+ typedef boost::iterator_range<const_iterator> const_range_type;
43
45
44
46
uri ()
45
47
: is_valid_(false ) {
46
48
47
49
}
48
50
51
+ // uri(const value_type *uri)
52
+ // : uri_(uri), is_valid_(false) {
53
+ // parse();
54
+ // }
55
+
56
+ uri (const string_type &uri)
57
+ : uri_(uri), is_valid_(false ) {
58
+ parse ();
59
+ }
60
+
49
61
template <
50
62
class FwdIter
51
63
>
@@ -54,11 +66,6 @@ class BOOST_URI_DECL uri {
54
66
parse ();
55
67
}
56
68
57
- uri (const string_type &uri)
58
- : uri_(uri), is_valid_(false ) {
59
- parse ();
60
- }
61
-
62
69
uri (const uri &other)
63
70
: uri_(other.uri_) {
64
71
parse ();
@@ -316,6 +323,26 @@ bool operator == (const uri &lhs, const uri &rhs) {
316
323
return boost::equal (lhs, rhs);
317
324
}
318
325
326
+ inline
327
+ bool operator == (const uri &lhs, const uri::string_type &rhs) {
328
+ return boost::equal (lhs, rhs);
329
+ }
330
+
331
+ inline
332
+ bool operator == (const uri::string_type &lhs, const uri &rhs) {
333
+ return boost::equal (lhs, rhs);
334
+ }
335
+
336
+ inline
337
+ bool operator == (const uri &lhs, const uri::value_type *rhs) {
338
+ return boost::equal (lhs, boost::as_literal (rhs));
339
+ }
340
+
341
+ inline
342
+ bool operator == (const uri::value_type *lhs, const uri &rhs) {
343
+ return boost::equal (boost::as_literal (lhs), rhs);
344
+ }
345
+
319
346
inline
320
347
bool operator != (const uri &lhs, const uri &rhs) {
321
348
return !(lhs == rhs);
0 commit comments