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

Unified Diff: pkg/intl/tool/generate_locale_data_files.dart

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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 | « pkg/http/test/utils.dart ('k') | pkg/webdriver/lib/webdriver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/tool/generate_locale_data_files.dart
diff --git a/pkg/intl/tool/generate_locale_data_files.dart b/pkg/intl/tool/generate_locale_data_files.dart
index b9999265972d78ce1b191dd03b5689cd26dbb1e2..a6fe140c8b86b60b7f3844a7cc0bbd4f9c4b8276 100644
--- a/pkg/intl/tool/generate_locale_data_files.dart
+++ b/pkg/intl/tool/generate_locale_data_files.dart
@@ -29,23 +29,24 @@ main() {
void writeLocaleList() {
var file = new File('${dataDirectory}localeList.dart');
- var outputStream = file.openOutputStream();
- outputStream.writeString(
+ var output = file.openWrite();
+ output.addString(
'// Copyright (c) 2012, the Dart project authors. Please see the '
'AUTHORS file\n// for details. All rights reserved. Use of this source'
'code is governed by a\n// BSD-style license that can be found in the'
' LICENSE file.\n\n'
'/// Hard-coded list of all available locales for dates.\n');
- outputStream.writeString('final availableLocalesForDateFormatting = const [');
+ output.addString('final availableLocalesForDateFormatting = const [');
List<String> allLocales = DateFormat.allLocalesWithSymbols();
allLocales.forEach((locale) {
- outputStream.writeString('"$locale"');
+ output.addString('"$locale"');
if (locale == allLocales.last) {
- outputStream.writeString('];');
+ output.addString('];');
} else {
- outputStream.writeString(',\n ');
+ output.addString(',\n ');
}
});
+ output.close();
}
void writeSymbolData() {
@@ -60,18 +61,18 @@ void writePatternData() {
void writeSymbols(locale, symbols) {
var file = new File('${dataDirectory}symbols/${locale}.json');
- var outputStream = file.openOutputStream();
- writeToJSON(symbols, outputStream);
- outputStream.close();
+ var output = file.openWrite();
+ writeToJSON(symbols, output);
+ output.close();
}
void writePatterns(locale, patterns) {
var file = new File('${dataDirectory}patterns/${locale}.json');
- var outputStream = file.openOutputStream();
- outputStream.writeString(json.stringify(patterns));
- outputStream.close();
+ var output = file.openWrite();
+ output.addString(json.stringify(patterns));
+ output.close();
}
-void writeToJSON(dynamic data, OutputStream out) {
- out.writeString(json.stringify(data.serializeToMap()));
+void writeToJSON(dynamic data, IOSink out) {
+ out.addString(json.stringify(data.serializeToMap()));
}
« no previous file with comments | « pkg/http/test/utils.dart ('k') | pkg/webdriver/lib/webdriver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698