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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 // Returns the port number of the url, or the default port number. | 286 // Returns the port number of the url, or the default port number. |
287 // If the scheme has no concept of port (or unknown default) returns | 287 // If the scheme has no concept of port (or unknown default) returns |
288 // PORT_UNSPECIFIED. | 288 // PORT_UNSPECIFIED. |
289 int EffectiveIntPort() const; | 289 int EffectiveIntPort() const; |
290 | 290 |
291 // Extracts the filename portion of the path and returns it. The filename | 291 // Extracts the filename portion of the path and returns it. The filename |
292 // is everything after the last slash in the path. This may be empty. | 292 // is everything after the last slash in the path. This may be empty. |
293 std::string ExtractFileName() const; | 293 std::string ExtractFileName() const; |
294 | 294 |
| 295 // Extracts the file extension portion of the path and returns it. The file |
| 296 // extension is everything after the last dot in the file name. This may be |
| 297 // empty. |
| 298 std::string ExtractFileExtension() const; |
| 299 |
295 // Returns the path that should be sent to the server. This is the path, | 300 // Returns the path that should be sent to the server. This is the path, |
296 // parameter, and query portions of the URL. It is guaranteed to be ASCII. | 301 // parameter, and query portions of the URL. It is guaranteed to be ASCII. |
297 std::string PathForRequest() const; | 302 std::string PathForRequest() const; |
298 | 303 |
299 // Returns the host, excluding the square brackets surrounding IPv6 address | 304 // Returns the host, excluding the square brackets surrounding IPv6 address |
300 // literals. This can be useful for passing to getaddrinfo(). | 305 // literals. This can be useful for passing to getaddrinfo(). |
301 std::string HostNoBrackets() const; | 306 std::string HostNoBrackets() const; |
302 | 307 |
303 // Returns true if this URL's host matches or is in the same domain as | 308 // Returns true if this URL's host matches or is in the same domain as |
304 // the given input string. For example if this URL was "www.google.com", | 309 // the given input string. For example if this URL was "www.google.com", |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // Used for nested schemes [currently only filesystem:]. | 361 // Used for nested schemes [currently only filesystem:]. |
357 GURL* inner_url_; | 362 GURL* inner_url_; |
358 | 363 |
359 // TODO bug 684583: Add encoding for query params. | 364 // TODO bug 684583: Add encoding for query params. |
360 }; | 365 }; |
361 | 366 |
362 // Stream operator so GURL can be used in assertion statements. | 367 // Stream operator so GURL can be used in assertion statements. |
363 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 368 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
364 | 369 |
365 #endif // URL_GURL_H_ | 370 #endif // URL_GURL_H_ |
OLD | NEW |