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

Unified Diff: runtime/bin/file.cc

Issue 8578003: Implement setPosition on File to seek to a byte position. (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
Index: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 58817ea629538ad9744e439ed1897d01e9dfdac5..d1d61082d83389640866804cf0c6ecc237fc1c5a 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -215,6 +215,22 @@ void FUNCTION_NAME(File_Position)(Dart_NativeArguments args) {
}
+void FUNCTION_NAME(File_SetPosition)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ intptr_t return_value = -1;
+ intptr_t value =
+ DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
+ File* file = reinterpret_cast<File*>(value);
+ if (file != NULL) {
+ int64_t position =
+ DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1));
+ return_value = file->SetPosition(position);
+ }
+ Dart_SetReturnValue(args, Dart_NewInteger(return_value));
+ Dart_ExitScope();
+}
+
+
void FUNCTION_NAME(File_Length)(Dart_NativeArguments args) {
Dart_EnterScope();
intptr_t return_value = -1;
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file.dart » ('j') | runtime/bin/file_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698