Flutter Engine
The Flutter Engine
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:3207
uint8_t value
int argument_count
Definition: fuchsia.cc:52
size_t length
char ** argv
Definition: library.h:9
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)
Definition: file_support.cc:25
bool ShouldCaptureStdout()
Definition: file_support.cc:33
void SetExecutableArguments(int script_index, char **argv)
Dart_NativeFunction LookupIONative(Dart_Handle name, int argument_count, bool *auto_setup_scope)
bool ShouldCaptureStderr()
Definition: file_support.cc:37
void CleanupDartIo()
void CloseFile(void *stream)
void BootstrapDartIo()
const uint8_t * LookupIONativeSymbol(Dart_NativeFunction nf)
void SetCaptureStderr(bool value)
Definition: file_support.cc:29
bool GetEntropy(uint8_t *buffer, intptr_t length)
void * OpenFile(const char *name, bool write)
void SetSystemTempDirectory(const char *system_temp)
Definition: dart_vm.cc:33
const char *const name
static int8_t data[kExtLength]
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
void write(SkWStream *wStream, const T &text)
Definition: skqp.cpp:188