Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
tonic::DartConverter< std::u16string > Struct Reference

#include <dart_converter.h>

Public Types

using NativeType = std::u16string
 
using FfiType = Dart_Handle
 

Static Public Member Functions

static Dart_Handle ToDart (const NativeType &val)
 
static void SetReturnValue (Dart_NativeArguments args, const NativeType &val)
 
static NativeType FromDart (Dart_Handle handle)
 
static NativeType FromArguments (Dart_NativeArguments args, int index, Dart_Handle &exception)
 
static NativeType FromFfi (FfiType val)
 
static FfiType ToFfi (NativeType val)
 
static const char * GetFfiRepresentation ()
 
static const char * GetDartRepresentation ()
 
static bool AllowedInLeafCall ()
 

Static Public Attributes

static constexpr const char * kFfiRepresentation = "Handle"
 
static constexpr const char * kDartRepresentation = "String"
 
static constexpr bool kAllowedInLeafCall = false
 

Detailed Description

Definition at line 327 of file dart_converter.h.

Member Typedef Documentation

◆ FfiType

using tonic::DartConverter< std::u16string >::FfiType = Dart_Handle

Definition at line 329 of file dart_converter.h.

◆ NativeType

using tonic::DartConverter< std::u16string >::NativeType = std::u16string

Definition at line 328 of file dart_converter.h.

Member Function Documentation

◆ AllowedInLeafCall()

static bool tonic::DartConverter< std::u16string >::AllowedInLeafCall ( )
inlinestatic

Definition at line 364 of file dart_converter.h.

364{ return kAllowedInLeafCall; }

◆ FromArguments()

static NativeType tonic::DartConverter< std::u16string >::FromArguments ( Dart_NativeArguments  args,
int  index,
Dart_Handle exception 
)
inlinestatic

Definition at line 354 of file dart_converter.h.

356 {
357 return FromDart(Dart_GetNativeArgument(args, index));
358 }
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static NativeType FromDart(Dart_Handle handle)

◆ FromDart()

static NativeType tonic::DartConverter< std::u16string >::FromDart ( Dart_Handle  handle)
inlinestatic

Definition at line 343 of file dart_converter.h.

343 {
344 if (Dart_IsNull(handle)) {
345 return std::u16string();
346 }
347 intptr_t length = 0;
348 Dart_StringLength(handle, &length);
349 std::vector<uint16_t> data(length);
350 Dart_StringToUTF16(handle, data.data(), &length);
351 return std::u16string(reinterpret_cast<char16_t*>(data.data()), length);
352 }
DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str, uint16_t *utf16_array, intptr_t *length)
DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t *length)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
size_t length
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41

◆ FromFfi()

static NativeType tonic::DartConverter< std::u16string >::FromFfi ( FfiType  val)
inlinestatic

Definition at line 360 of file dart_converter.h.

360{ return FromDart(val); }

◆ GetDartRepresentation()

static const char * tonic::DartConverter< std::u16string >::GetDartRepresentation ( )
inlinestatic

Definition at line 363 of file dart_converter.h.

363{ return kDartRepresentation; }
static constexpr const char * kDartRepresentation

◆ GetFfiRepresentation()

static const char * tonic::DartConverter< std::u16string >::GetFfiRepresentation ( )
inlinestatic

Definition at line 362 of file dart_converter.h.

362{ return kFfiRepresentation; }
static constexpr const char * kFfiRepresentation

◆ SetReturnValue()

static void tonic::DartConverter< std::u16string >::SetReturnValue ( Dart_NativeArguments  args,
const NativeType val 
)
inlinestatic

Definition at line 339 of file dart_converter.h.

339 {
341 }
DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args, Dart_Handle retval)
static Dart_Handle ToDart(const NativeType &val)

◆ ToDart()

static Dart_Handle tonic::DartConverter< std::u16string >::ToDart ( const NativeType val)
inlinestatic

Definition at line 334 of file dart_converter.h.

334 {
336 reinterpret_cast<const uint16_t*>(val.data()), val.length());
337 }
DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t *utf16_array, intptr_t length)

◆ ToFfi()

static FfiType tonic::DartConverter< std::u16string >::ToFfi ( NativeType  val)
inlinestatic

Definition at line 361 of file dart_converter.h.

361{ return ToDart(val); }

Member Data Documentation

◆ kAllowedInLeafCall

constexpr bool tonic::DartConverter< std::u16string >::kAllowedInLeafCall = false
staticconstexpr

Definition at line 332 of file dart_converter.h.

◆ kDartRepresentation

constexpr const char* tonic::DartConverter< std::u16string >::kDartRepresentation = "String"
staticconstexpr

Definition at line 331 of file dart_converter.h.

◆ kFfiRepresentation

constexpr const char* tonic::DartConverter< std::u16string >::kFfiRepresentation = "Handle"
staticconstexpr

Definition at line 330 of file dart_converter.h.


The documentation for this struct was generated from the following file: