Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: sdk/lib/core/uri.dart

Issue 23686021: Add property base to the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/corelib/uri_base_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 * new Uri.file(r"C:"); // Throws as path with drive letter 351 * new Uri.file(r"C:"); // Throws as path with drive letter
352 * // is not absolute. 352 * // is not absolute.
353 * 353 *
354 * If the path passed is not a legal file path [ArgumentError] is thrown. 354 * If the path passed is not a legal file path [ArgumentError] is thrown.
355 */ 355 */
356 factory Uri.file(String path, {bool windows}) { 356 factory Uri.file(String path, {bool windows}) {
357 windows = windows == null ? Uri._isWindows : windows; 357 windows = windows == null ? Uri._isWindows : windows;
358 return windows ? _makeWindowsFileUrl(path) : _makeFileUri(path); 358 return windows ? _makeWindowsFileUrl(path) : _makeFileUri(path);
359 } 359 }
360 360
361 /**
362 * Returns the natural base URI for the current platform.
363 *
364 * When running in a browser this will be the current URL (from
floitsch 2013/09/18 09:06:26 is the current URL
Søren Gjesse 2013/09/25 09:17:08 Done.
365 * `window.location.href`).
366 *
367 * When not running in a browser this will be a file URI referencing
floitsch 2013/09/18 09:06:26 is the file URI ...
Søren Gjesse 2013/09/25 09:17:08 Done.
368 * the current working directory.
369 */
370 external static Uri get base;
371
361 external static bool get _isWindows; 372 external static bool get _isWindows;
362 373
363 static _checkNonWindowsPathReservedCharacters(List<String> segments, 374 static _checkNonWindowsPathReservedCharacters(List<String> segments,
364 bool argumentError) { 375 bool argumentError) {
365 segments.forEach((segment) { 376 segments.forEach((segment) {
366 if (segment.contains("/")) { 377 if (segment.contains("/")) {
367 if (argumentError) { 378 if (argumentError) {
368 throw new ArgumentError("Illegal path character $segment"); 379 throw new ArgumentError("Illegal path character $segment");
369 } else { 380 } else {
370 throw new UnsupportedError("Illegal path character $segment"); 381 throw new UnsupportedError("Illegal path character $segment");
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 void clear() { 1674 void clear() {
1664 throw new UnsupportedError("Cannot modify an unmodifiable map"); 1675 throw new UnsupportedError("Cannot modify an unmodifiable map");
1665 } 1676 }
1666 void forEach(void f(K key, V value)) => _map.forEach(f); 1677 void forEach(void f(K key, V value)) => _map.forEach(f);
1667 Iterable<K> get keys => _map.keys; 1678 Iterable<K> get keys => _map.keys;
1668 Iterable<V> get values => _map.values; 1679 Iterable<V> get values => _map.values;
1669 int get length => _map.length; 1680 int get length => _map.length;
1670 bool get isEmpty => _map.isEmpty; 1681 bool get isEmpty => _map.isEmpty;
1671 bool get isNotEmpty => _map.isNotEmpty; 1682 bool get isNotEmpty => _map.isNotEmpty;
1672 } 1683 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/corelib/uri_base_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698