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

Side by Side Diff: runtime/bin/platform.cc

Issue 2786183003: [dart:io] Reland: Adds Platform.localeName (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « runtime/bin/platform.h ('k') | runtime/bin/platform_android.cc » ('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 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "bin/platform.h" 7 #include "bin/platform.h"
8 8
9 #include "bin/file.h" 9 #include "bin/file.h"
10 #include "bin/utils.h" 10 #include "bin/utils.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 Dart_SetReturnValue(args, result); 103 Dart_SetReturnValue(args, result);
104 } 104 }
105 } 105 }
106 106
107 107
108 void FUNCTION_NAME(Platform_GetVersion)(Dart_NativeArguments args) { 108 void FUNCTION_NAME(Platform_GetVersion)(Dart_NativeArguments args) {
109 Dart_SetReturnValue(args, Dart_NewStringFromCString(Dart_VersionString())); 109 Dart_SetReturnValue(args, Dart_NewStringFromCString(Dart_VersionString()));
110 } 110 }
111 111
112
113 void FUNCTION_NAME(Platform_LocaleName)(Dart_NativeArguments args) {
114 const char* locale = Platform::LocaleName();
115 if (locale == NULL) {
116 Dart_SetReturnValue(args, DartUtils::NewDartOSError());
117 } else {
118 Dart_SetReturnValue(args, Dart_NewStringFromCString(locale));
119 }
120 }
121
112 } // namespace bin 122 } // namespace bin
113 } // namespace dart 123 } // namespace dart
114 124
115 #endif // !defined(DART_IO_DISABLED) 125 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/platform.h ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698