Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
dart_io_api.h
Go to the documentation of this file.
1// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5#ifndef RUNTIME_INCLUDE_BIN_DART_IO_API_H_
6#define RUNTIME_INCLUDE_BIN_DART_IO_API_H_
7
8#include "../dart_tools_api.h"
9
10namespace dart {
11namespace bin {
12
13// Bootstraps 'dart:io'.
14void BootstrapDartIo();
15
16// Cleans up 'dart:io'.
17void CleanupDartIo();
18
19// Lets dart:io know where the system temporary directory is located.
20// Currently only wired up on Android.
21void SetSystemTempDirectory(const char* system_temp);
22
23// Tells the system whether to capture Stdout events.
24void SetCaptureStdout(bool value);
25
26// Tells the system whether to capture Stderr events.
27void SetCaptureStderr(bool value);
28
29// Should Stdout events be captured?
31
32// Should Stderr events be captured?
34
35// Set the executable name used by Platform.executable.
36void SetExecutableName(const char* executable_name);
37
38// Set the arguments used by Platform.executableArguments.
39void SetExecutableArguments(int script_index, char** argv);
40
41// Set dart:io implementation specific fields of Dart_EmbedderInformation.
43
44// Appropriate to assign to Dart_InitializeParams.file_open/read/write/close.
45void* OpenFile(const char* name, bool write);
46void ReadFile(uint8_t** data, intptr_t* file_len, void* stream);
47void WriteFile(const void* buffer, intptr_t num_bytes, void* stream);
48void CloseFile(void* stream);
49
50// Generates 'length' random bytes into 'buffer'. Returns true on success
51// and false on failure. This is appropriate to assign to
52// Dart_InitializeParams.entropy_source.
53bool GetEntropy(uint8_t* buffer, intptr_t length);
54
55// Performs a lookup of the I/O Dart_NativeFunction with a specified 'name' and
56// 'argument_count'. Returns NULL if no I/O native function with a matching
57// name and parameter count is found.
60 bool* auto_setup_scope);
61
62// Returns the symbol for I/O native function 'nf'. Returns NULL if 'nf' is not
63// a valid I/O native function.
65
66} // namespace bin
67} // namespace dart
68
69#endif // RUNTIME_INCLUDE_BIN_DART_IO_API_H_
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
struct _Dart_Handle * Dart_Handle
Definition dart_api.h:258
void(* Dart_NativeFunction)(Dart_NativeArguments arguments)
Definition dart_api.h:3198
static const uint8_t buffer[]
int argument_count
Definition fuchsia.cc:52
size_t length
void SetExecutableName(const char *executable_name)
void WriteFile(const void *buffer, intptr_t num_bytes, void *stream)
void ReadFile(uint8_t **data, intptr_t *file_len, void *stream)
void GetIOEmbedderInformation(Dart_EmbedderInformation *info)
void SetCaptureStdout(bool value)
bool ShouldCaptureStdout()
void SetExecutableArguments(int script_index, char **argv)
Dart_NativeFunction LookupIONative(Dart_Handle name, int argument_count, bool *auto_setup_scope)
bool ShouldCaptureStderr()
void CleanupDartIo()
void CloseFile(void *stream)
void BootstrapDartIo()
const uint8_t * LookupIONativeSymbol(Dart_NativeFunction nf)
void SetCaptureStderr(bool value)
bool GetEntropy(uint8_t *buffer, intptr_t length)
void * OpenFile(const char *name, bool write)
void SetSystemTempDirectory(const char *system_temp)
const char *const name
static int8_t data[kExtLength]
void write(SkWStream *wStream, const T &text)
Definition skqp.cpp:188