| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "bin/file.h" | 5 #include "bin/file.h" |
| 6 | 6 |
| 7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
| 8 #include "bin/dartutils.h" | 8 #include "bin/dartutils.h" |
| 9 | 9 |
| 10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 | 246 |
| 247 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) { | 247 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) { |
| 248 Dart_EnterScope(); | 248 Dart_EnterScope(); |
| 249 const char* str = | 249 const char* str = |
| 250 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); | 250 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); |
| 251 bool result = File::Create(str); | 251 bool result = File::Create(str); |
| 252 Dart_SetReturnValue(args, Dart_NewBoolean(result)); | 252 Dart_SetReturnValue(args, Dart_NewBoolean(result)); |
| 253 Dart_ExitScope(); | 253 Dart_ExitScope(); |
| 254 } | 254 } |
| 255 |
| 256 |
| 257 void FUNCTION_NAME(File_FullPath)(Dart_NativeArguments args) { |
| 258 Dart_EnterScope(); |
| 259 const char* str = |
| 260 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); |
| 261 char* path = File::GetCanonicalPath(str); |
| 262 if (path != NULL) { |
| 263 Dart_SetReturnValue(args, Dart_NewString(path)); |
| 264 free(path); |
| 265 } |
| 266 Dart_ExitScope(); |
| 267 } |
| OLD | NEW |