| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) { | 264 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) { |
| 265 Dart_EnterScope(); | 265 Dart_EnterScope(); |
| 266 const char* str = | 266 const char* str = |
| 267 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); | 267 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); |
| 268 bool result = File::Create(str); | 268 bool result = File::Create(str); |
| 269 Dart_SetReturnValue(args, Dart_NewBoolean(result)); | 269 Dart_SetReturnValue(args, Dart_NewBoolean(result)); |
| 270 Dart_ExitScope(); | 270 Dart_ExitScope(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 | 273 |
| 274 void FUNCTION_NAME(File_Delete)(Dart_NativeArguments args) { |
| 275 Dart_EnterScope(); |
| 276 const char* str = |
| 277 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); |
| 278 bool result = File::Delete(str); |
| 279 Dart_SetReturnValue(args, Dart_NewBoolean(result)); |
| 280 Dart_ExitScope(); |
| 281 } |
| 282 |
| 283 |
| 274 void FUNCTION_NAME(File_FullPath)(Dart_NativeArguments args) { | 284 void FUNCTION_NAME(File_FullPath)(Dart_NativeArguments args) { |
| 275 Dart_EnterScope(); | 285 Dart_EnterScope(); |
| 276 const char* str = | 286 const char* str = |
| 277 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); | 287 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); |
| 278 char* path = File::GetCanonicalPath(str); | 288 char* path = File::GetCanonicalPath(str); |
| 279 if (path != NULL) { | 289 if (path != NULL) { |
| 280 Dart_SetReturnValue(args, Dart_NewString(path)); | 290 Dart_SetReturnValue(args, Dart_NewString(path)); |
| 281 free(path); | 291 free(path); |
| 282 } | 292 } |
| 283 Dart_ExitScope(); | 293 Dart_ExitScope(); |
| 284 } | 294 } |
| OLD | NEW |