Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
fl_binary_codec.cc File Reference
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_codec.h"
#include <gmodule.h>

Go to the source code of this file.

Classes

struct  _FlBinaryCodec
 

Functions

static GBytes * fl_binary_codec_encode_message (FlMessageCodec *codec, FlValue *value, GError **error)
 
static FlValuefl_binary_codec_decode_message (FlMessageCodec *codec, GBytes *message, GError **error)
 
static void fl_binary_codec_class_init (FlBinaryCodecClass *klass)
 
static void fl_binary_codec_init (FlBinaryCodec *self)
 
G_MODULE_EXPORT FlBinaryCodec * fl_binary_codec_new ()
 

Function Documentation

◆ fl_binary_codec_class_init()

static void fl_binary_codec_class_init ( FlBinaryCodecClass *  klass)
static

Definition at line 42 of file fl_binary_codec.cc.

42 {
43 FL_MESSAGE_CODEC_CLASS(klass)->encode_message =
45 FL_MESSAGE_CODEC_CLASS(klass)->decode_message =
47}
static GBytes * fl_binary_codec_encode_message(FlMessageCodec *codec, FlValue *value, GError **error)
static FlValue * fl_binary_codec_decode_message(FlMessageCodec *codec, GBytes *message, GError **error)

◆ fl_binary_codec_decode_message()

static FlValue * fl_binary_codec_decode_message ( FlMessageCodec *  codec,
GBytes *  message,
GError **  error 
)
static

Definition at line 33 of file fl_binary_codec.cc.

35 {
36 gsize data_length;
37 const uint8_t* data =
38 static_cast<const uint8_t*>(g_bytes_get_data(message, &data_length));
39 return fl_value_new_uint8_list(data, data_length);
40}
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition fl_value.cc:292
Win32Message message
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

◆ fl_binary_codec_encode_message()

static GBytes * fl_binary_codec_encode_message ( FlMessageCodec *  codec,
FlValue value,
GError **  error 
)
static

Definition at line 18 of file fl_binary_codec.cc.

20 {
22 g_set_error(error, FL_MESSAGE_CODEC_ERROR,
24 "Only uint8[] values supported");
25 return nullptr;
26 }
27
28 return g_bytes_new(fl_value_get_uint8_list(value),
29 fl_value_get_length(value));
30}
@ FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE
#define FL_MESSAGE_CODEC_ERROR
const uint8_t uint32_t uint32_t GError ** error
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition fl_value.cc:466
G_MODULE_EXPORT const uint8_t * fl_value_get_uint8_list(FlValue *self)
Definition fl_value.cc:689
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition fl_value.cc:724
@ FL_VALUE_TYPE_UINT8_LIST
Definition fl_value.h:70

◆ fl_binary_codec_init()

static void fl_binary_codec_init ( FlBinaryCodec *  self)
static

Definition at line 49 of file fl_binary_codec.cc.

49{}

◆ fl_binary_codec_new()

G_MODULE_EXPORT FlBinaryCodec * fl_binary_codec_new ( )

Definition at line 51 of file fl_binary_codec.cc.

51 {
52 return static_cast<FlBinaryCodec*>(
53 g_object_new(fl_binary_codec_get_type(), nullptr));
54}