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

Unified Diff: runtime/bin/file.cc

Issue 8437056: Implemented File create API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 6d69c975979e81f9389216c0ee2b92908f0b51fb..2289c0d0364bb4e76e27b6d8a473559a5dc80a53 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -45,7 +45,7 @@ void FUNCTION_NAME(File_Open)(Dart_NativeArguments args) {
const char* filename =
DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
bool writable = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 1));
- File* file = File::OpenFile(filename, writable);
+ File* file = File::Open(filename, writable);
Dart_SetReturnValue(args, Dart_NewInteger(reinterpret_cast<intptr_t>(file)));
Dart_ExitScope();
}
@@ -55,7 +55,7 @@ void FUNCTION_NAME(File_Exists)(Dart_NativeArguments args) {
Dart_EnterScope();
const char* filename =
DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
- bool exists = File::FileExists(filename);
+ bool exists = File::Exists(filename);
Dart_SetReturnValue(args, Dart_NewBoolean(exists));
Dart_ExitScope();
}
@@ -242,3 +242,13 @@ void FUNCTION_NAME(File_Flush)(Dart_NativeArguments args) {
Dart_SetReturnValue(args, Dart_NewInteger(return_value));
Dart_ExitScope();
}
+
+
+void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ const char* str =
+ DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+ bool result = File::Create(str);
+ Dart_SetReturnValue(args, Dart_NewBoolean(result));
+ Dart_ExitScope();
+}
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698