Flutter Engine
The Flutter Engine
typed_data_utils.h
Go to the documentation of this file.
1// Copyright (c) 2018, 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_BIN_TYPED_DATA_UTILS_H_
6#define RUNTIME_BIN_TYPED_DATA_UTILS_H_
7
8#include "include/dart_api.h"
9#include "platform/globals.h"
10
11namespace dart {
12namespace bin {
13
15 public:
18
19 void Release();
20
21 const char* GetCString() const {
22 return reinterpret_cast<const char*>(data_);
23 }
24
25 const char* GetScopedCString() const;
26
27 void* data() const { return data_; }
28 intptr_t length() const { return length_; }
29 intptr_t size_in_bytes() const;
30 Dart_TypedData_Type type() const { return type_; }
31
32 private:
33 Dart_Handle data_handle_;
34 void* data_;
35 intptr_t length_;
37
38 DISALLOW_ALLOCATION();
39 DISALLOW_IMPLICIT_CONSTRUCTORS(TypedDataScope);
40};
41
42} // namespace bin
43} // namespace dart
44
45#endif // RUNTIME_BIN_TYPED_DATA_UTILS_H_
const char * GetScopedCString() const
Dart_TypedData_Type type() const
const char * GetCString() const
TypedDataScope(Dart_Handle data)
intptr_t size_in_bytes() const
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
Dart_TypedData_Type
Definition: dart_api.h:2612
Definition: dart_vm.cc:33