OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * A parsed URI, such as a URL. | 8 * A parsed URI, such as a URL. |
9 * | 9 * |
10 * **See also:** | 10 * **See also:** |
(...skipping 12 matching lines...) Expand all Loading... |
23 // the port is the default port for the scheme. | 23 // the port is the default port for the scheme. |
24 // Set to the value of the default port if an empty port was supplied. | 24 // Set to the value of the default port if an empty port was supplied. |
25 int _port; | 25 int _port; |
26 // The path. Always non-null. | 26 // The path. Always non-null. |
27 String _path; | 27 String _path; |
28 | 28 |
29 /** | 29 /** |
30 * Returns the scheme component. | 30 * Returns the scheme component. |
31 * | 31 * |
32 * Returns the empty string if there is no scheme component. | 32 * Returns the empty string if there is no scheme component. |
| 33 * |
| 34 * A URI scheme is case insensitive. |
| 35 * The returned scheme is canonicalized to lowercase letters. |
33 */ | 36 */ |
34 // We represent the missing scheme as an empty string. | 37 // We represent the missing scheme as an empty string. |
35 // A valid scheme cannot be empty. | 38 // A valid scheme cannot be empty. |
36 final String scheme; | 39 final String scheme; |
37 | 40 |
38 /** | 41 /** |
39 * Returns the authority component. | 42 * Returns the authority component. |
40 * | 43 * |
41 * The authority is formatted from the [userInfo], [host] and [port] | 44 * The authority is formatted from the [userInfo], [host] and [port] |
42 * parts. | 45 * parts. |
(...skipping 24 matching lines...) Expand all Loading... |
67 String get userInfo => _userInfo; | 70 String get userInfo => _userInfo; |
68 | 71 |
69 /** | 72 /** |
70 * Returns the host part of the authority component. | 73 * Returns the host part of the authority component. |
71 * | 74 * |
72 * Returns the empty string if there is no authority component and | 75 * Returns the empty string if there is no authority component and |
73 * hence no host. | 76 * hence no host. |
74 * | 77 * |
75 * If the host is an IP version 6 address, the surrounding `[` and `]` is | 78 * If the host is an IP version 6 address, the surrounding `[` and `]` is |
76 * removed. | 79 * removed. |
| 80 * |
| 81 * The host string is case-insensitive. |
| 82 * The returned host name is canonicalized to lower-case |
| 83 * with upper-case percent-escapes. |
77 */ | 84 */ |
78 String get host { | 85 String get host { |
79 if (_host == null) return ""; | 86 if (_host == null) return ""; |
80 if (_host.startsWith('[')) { | 87 if (_host.startsWith('[')) { |
81 return _host.substring(1, _host.length - 1); | 88 return _host.substring(1, _host.length - 1); |
82 } | 89 } |
83 return _host; | 90 return _host; |
84 } | 91 } |
85 | 92 |
86 /** | 93 /** |
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 0xafff, // 0x30 - 0x3f 1111111111110101 | 2471 0xafff, // 0x30 - 0x3f 1111111111110101 |
2465 // @ABCDEFGHIJKLMNO | 2472 // @ABCDEFGHIJKLMNO |
2466 0xffff, // 0x40 - 0x4f 1111111111111111 | 2473 0xffff, // 0x40 - 0x4f 1111111111111111 |
2467 // PQRSTUVWXYZ _ | 2474 // PQRSTUVWXYZ _ |
2468 0x87ff, // 0x50 - 0x5f 1111111111100001 | 2475 0x87ff, // 0x50 - 0x5f 1111111111100001 |
2469 // abcdefghijklmno | 2476 // abcdefghijklmno |
2470 0xfffe, // 0x60 - 0x6f 0111111111111111 | 2477 0xfffe, // 0x60 - 0x6f 0111111111111111 |
2471 // pqrstuvwxyz ~ | 2478 // pqrstuvwxyz ~ |
2472 0x47ff]; // 0x70 - 0x7f 1111111111100010 | 2479 0x47ff]; // 0x70 - 0x7f 1111111111100010 |
2473 } | 2480 } |
OLD | NEW |