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

Unified Diff: utils/apidoc/apidoc.dart

Issue 16848002: Add toUri and fromUri functions to pathos. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Preserve trailing separators. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/utils.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/apidoc.dart
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index ef6bae54202583ff08ceee57b6f602620740bff7..74a798e844c6bf5f62609b79ed8a24fd9b08be63 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -148,7 +148,7 @@ void main() {
}
if (new File.fromPath(libPath).existsSync()) {
- apidocLibraries.add(_pathToFileUri(libPath.toNativePath()));
+ apidocLibraries.add(pathos.toUri(libPath.toNativePath()));
includedLibraries.add(libName);
} else {
print('Warning: could not find package at $path');
@@ -162,7 +162,7 @@ void main() {
for (var lib in extraLibraries) {
var libPath = new Path('../../$lib');
if (new File.fromPath(libPath).existsSync()) {
- apidocLibraries.add(_pathToFileUri(libPath.toNativePath()));
+ apidocLibraries.add(pathos.toUri(libPath.toNativePath()));
var libName = libPath.filename.replaceAll('.dart', '');
includedLibraries.add(libName);
}
@@ -481,13 +481,3 @@ class Apidoc extends Dartdoc {
}
}
-/** Converts a local path string to a `file:` [Uri]. */
-Uri _pathToFileUri(String path) {
- path = pathos.absolute(path);
- if (Platform.operatingSystem != 'windows') {
- return Uri.parse('file://$path');
- } else {
- return Uri.parse('file:///${path.replaceAll("\\", "/")}');
- }
-}
-
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698