| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <iosfwd> | 10 #include <iosfwd> |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 316 } |
| 317 base::StringPiece port_piece() const { | 317 base::StringPiece port_piece() const { |
| 318 return ComponentStringPiece(parsed_.port); | 318 return ComponentStringPiece(parsed_.port); |
| 319 } | 319 } |
| 320 | 320 |
| 321 // Including first slash following host, up to the query. The URL | 321 // Including first slash following host, up to the query. The URL |
| 322 // "http://www.google.com/" has a path of "/". | 322 // "http://www.google.com/" has a path of "/". |
| 323 bool has_path() const { | 323 bool has_path() const { |
| 324 return parsed_.path.len >= 0; | 324 return parsed_.path.len >= 0; |
| 325 } | 325 } |
| 326 std::string path() const { | 326 |
| 327 return ComponentString(parsed_.path); | 327 base::StringPiece path() const { return ComponentStringPiece(parsed_.path); } |
| 328 } | |
| 329 base::StringPiece path_piece() const { | 328 base::StringPiece path_piece() const { |
| 330 return ComponentStringPiece(parsed_.path); | 329 return ComponentStringPiece(parsed_.path); |
| 331 } | 330 } |
| 332 | 331 |
| 333 // Stuff following '?' up to the ref. The getters will not include the '?'. | 332 // Stuff following '?' up to the ref. The getters will not include the '?'. |
| 334 bool has_query() const { | 333 bool has_query() const { |
| 335 return parsed_.query.len >= 0; | 334 return parsed_.query.len >= 0; |
| 336 } | 335 } |
| 337 std::string query() const { | 336 std::string query() const { |
| 338 return ComponentString(parsed_.query); | 337 return ComponentString(parsed_.query); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 URL_EXPORT bool operator==(const GURL& x, const GURL& y); | 452 URL_EXPORT bool operator==(const GURL& x, const GURL& y); |
| 454 URL_EXPORT bool operator!=(const GURL& x, const GURL& y); | 453 URL_EXPORT bool operator!=(const GURL& x, const GURL& y); |
| 455 | 454 |
| 456 // Equality operator for comparing raw spec_. This should be used in place of | 455 // Equality operator for comparing raw spec_. This should be used in place of |
| 457 // url == GURL(spec) where |spec| is known (i.e. constants). This is to prevent | 456 // url == GURL(spec) where |spec| is known (i.e. constants). This is to prevent |
| 458 // needlessly re-parsing |spec| into a temporary GURL. | 457 // needlessly re-parsing |spec| into a temporary GURL. |
| 459 URL_EXPORT bool operator==(const GURL& x, const base::StringPiece& spec); | 458 URL_EXPORT bool operator==(const GURL& x, const base::StringPiece& spec); |
| 460 URL_EXPORT bool operator!=(const GURL& x, const base::StringPiece& spec); | 459 URL_EXPORT bool operator!=(const GURL& x, const base::StringPiece& spec); |
| 461 | 460 |
| 462 #endif // URL_GURL_H_ | 461 #endif // URL_GURL_H_ |
| OLD | NEW |