| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef URL_GURL_H_ | 5 #ifndef URL_GURL_H_ |
| 6 #define URL_GURL_H_ | 6 #define URL_GURL_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // | 105 // |
| 106 // The returned parsed structure will reference into the raw spec, which may | 106 // The returned parsed structure will reference into the raw spec, which may |
| 107 // or may not be valid. If you are using this to index into the spec, BE | 107 // or may not be valid. If you are using this to index into the spec, BE |
| 108 // SURE YOU ARE USING possibly_invalid_spec() to get the spec, and that you | 108 // SURE YOU ARE USING possibly_invalid_spec() to get the spec, and that you |
| 109 // don't do anything "important" with invalid specs. | 109 // don't do anything "important" with invalid specs. |
| 110 const url::Parsed& parsed_for_possibly_invalid_spec() const { | 110 const url::Parsed& parsed_for_possibly_invalid_spec() const { |
| 111 return parsed_; | 111 return parsed_; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Defiant equality operator! | 114 // Defiant equality operator! |
| 115 bool operator==(const GURL& other) const { | 115 bool operator==(const GURL& other) const; |
| 116 return spec_ == other.spec_; | 116 bool operator!=(const GURL& other) const; |
| 117 } | |
| 118 bool operator!=(const GURL& other) const { | |
| 119 return spec_ != other.spec_; | |
| 120 } | |
| 121 | 117 |
| 122 // Allows GURL to used as a key in STL (for example, a std::set or std::map). | 118 // Allows GURL to used as a key in STL (for example, a std::set or std::map). |
| 123 bool operator<(const GURL& other) const { | 119 bool operator<(const GURL& other) const; |
| 124 return spec_ < other.spec_; | 120 bool operator>(const GURL& other) const; |
| 125 } | |
| 126 bool operator>(const GURL& other) const { | |
| 127 return spec_ > other.spec_; | |
| 128 } | |
| 129 | 121 |
| 130 // Resolves a URL that's possibly relative to this object's URL, and returns | 122 // Resolves a URL that's possibly relative to this object's URL, and returns |
| 131 // it. Absolute URLs are also handled according to the rules of URLs on web | 123 // it. Absolute URLs are also handled according to the rules of URLs on web |
| 132 // pages. | 124 // pages. |
| 133 // | 125 // |
| 134 // It may be impossible to resolve the URLs properly. If the input is not | 126 // It may be impossible to resolve the URLs properly. If the input is not |
| 135 // "standard" (SchemeIsStandard() == false) and the input looks relative, we | 127 // "standard" (SchemeIsStandard() == false) and the input looks relative, we |
| 136 // can't resolve it. In these cases, the result will be an empty, invalid | 128 // can't resolve it. In these cases, the result will be an empty, invalid |
| 137 // GURL. | 129 // GURL. |
| 138 // | 130 // |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 // Used for nested schemes [currently only filesystem:]. | 396 // Used for nested schemes [currently only filesystem:]. |
| 405 scoped_ptr<GURL> inner_url_; | 397 scoped_ptr<GURL> inner_url_; |
| 406 | 398 |
| 407 // TODO bug 684583: Add encoding for query params. | 399 // TODO bug 684583: Add encoding for query params. |
| 408 }; | 400 }; |
| 409 | 401 |
| 410 // Stream operator so GURL can be used in assertion statements. | 402 // Stream operator so GURL can be used in assertion statements. |
| 411 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 403 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 412 | 404 |
| 413 #endif // URL_GURL_H_ | 405 #endif // URL_GURL_H_ |
| OLD | NEW |