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

Side by Side Diff: samples/buildhook1/test.dart

Issue 11412033: Rename File.readAsText to File.readAsString. There is no Text type in Dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « samples/buildhook1/build.dart ('k') | samples/buildhook2/bin/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 import "dart:io"; 5 import "dart:io";
6 6
7 /** 7 /**
8 * In order to generate test.foobar, make an edit to test.foo. 8 * In order to generate test.foobar, make an edit to test.foo.
9 */ 9 */
10 void main() { 10 void main() {
11 printContents("test.foo"); 11 printContents("test.foo");
12 print(""); 12 print("");
13 printContents("test.foobar"); 13 printContents("test.foobar");
14 } 14 }
15 15
16 void printContents(String file) { 16 void printContents(String file) {
17 print("the contents of ${file} are:"); 17 print("the contents of ${file} are:");
18 18
19 var f = new File(file); 19 var f = new File(file);
20 20
21 if (f.existsSync()) { 21 if (f.existsSync()) {
22 String contents = new File(file).readAsTextSync(); 22 String contents = new File(file).readAsStringSync();
23 23
24 print("[${contents}]"); 24 print("[${contents}]");
25 } else { 25 } else {
26 print("[]"); 26 print("[]");
27 } 27 }
28 } 28 }
OLDNEW
« no previous file with comments | « samples/buildhook1/build.dart ('k') | samples/buildhook2/bin/test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698