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

Unified Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 2165843002: Add a toUri method to Resource (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added tests Created 4 years, 5 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
Index: pkg/analyzer/lib/file_system/memory_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index 1943ddf2ba4f21535b3d230dea190912c357ec2f..cd8e14909cd26fcaeafbe5d77585426a751f3195 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -314,6 +314,9 @@ class _MemoryDummyLink extends _MemoryResource implements File {
}
@override
+ Uri toUri() => new Uri.file(path, windows: _provider.pathContext == windows);
+
+ @override
void writeAsBytesSync(List<int> bytes) {
throw new FileSystemException(path, 'File could not be written');
}
@@ -388,6 +391,9 @@ class _MemoryFile extends _MemoryResource implements File {
}
@override
+ Uri toUri() => new Uri.file(path, windows: _provider.pathContext == windows);
+
+ @override
void writeAsBytesSync(List<int> bytes) {
_provider._setFileBytes(this, bytes);
}
@@ -561,6 +567,10 @@ class _MemoryFolder extends _MemoryResource implements Folder {
}
return contains(path);
}
+
+ @override
+ Uri toUri() =>
+ new Uri.directory(path, windows: _provider.pathContext == windows);
}
/**
« no previous file with comments | « pkg/analyzer/lib/file_system/file_system.dart ('k') | pkg/analyzer/lib/file_system/physical_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698